added filter, only display logged user associated projects
This commit is contained in:
parent
a096f3d743
commit
1caeeb890d
@ -178,7 +178,9 @@ const EmployeeList = () => {
|
||||
<>
|
||||
<option value="">All Employees</option>
|
||||
{Array.isArray(projects) &&
|
||||
projects.map((item) => (
|
||||
projects
|
||||
.filter((item) => loginUser?.projects?.includes(String(item.id)))
|
||||
.map((item) => (
|
||||
<option key={item.id} value={item.id}>
|
||||
{item.name}
|
||||
</option>
|
||||
|
||||
@ -176,10 +176,13 @@ const ProjectList = () =>
|
||||
{loading && <p className="text-center">Loading...</p>}
|
||||
|
||||
|
||||
{currentItems &&
|
||||
currentItems.map((item) => (
|
||||
<ProjectCard projectData={item} key={item.id}></ProjectCard>
|
||||
))}
|
||||
{Array.isArray(currentItems) && loginUser?.projects && (
|
||||
currentItems
|
||||
.filter((item) => loginUser.projects.includes(String(item.id)))
|
||||
.map((item) => (
|
||||
<ProjectCard projectData={item} key={item.id} />
|
||||
))
|
||||
)}
|
||||
</div>
|
||||
{/* Pagination */}
|
||||
{!loading && (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user