Skip to content

Commit

Permalink
added past projects for department projects
Browse files Browse the repository at this point in the history
  • Loading branch information
Liviujmk committed Mar 17, 2024
1 parent 4ccc504 commit 1c3c340
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/projects/projects.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -813,20 +813,18 @@ export class ProjectsService {
members.map(async (member) => {
await Promise.all(
member.projects.map(async (project) => {
if (!project.endWork) {
const projectData = {
id: project.project.id,
name: project.project.name,
deadlineDate: project.project.deadlineDate,
status: project.project.status,
members: await this.prismaService.employeeProject.findMany({
where: { employeeId: member.id },
select: { employee: { select: { name: true } } },
}),
};

uniqueProjects.add(JSON.stringify(projectData));
}
const projectData = {
id: project.project.id,
name: project.project.name,
deadlineDate: project.project.deadlineDate,
status: project.project.status,
members: await this.prismaService.employeeProject.findMany({
where: { employeeId: member.id },
select: { employee: { select: { name: true } } },
}),
};

uniqueProjects.add(JSON.stringify(projectData));
}),
);
}),
Expand Down

0 comments on commit 1c3c340

Please sign in to comment.