Skip to content

Commit b91fbbd

Browse files
authored
Merge pull request #71 from graceful-tech12/fix/31-projects-crud
feat(web): implement projects CRUD dashboard
2 parents e074108 + c4be5a7 commit b91fbbd

9 files changed

Lines changed: 842 additions & 474 deletions

File tree

apps/api/src/modules/projects/projects.service.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,31 @@ export class ProjectsService {
8585

8686
const project = await this.prisma.db.project.findUnique({
8787
where: { id },
88-
include: { _count: { select: { audits: true, contracts: true } } },
88+
include: {
89+
_count: { select: { audits: true, contracts: true } },
90+
contracts: {
91+
select: {
92+
id: true,
93+
name: true,
94+
filePath: true,
95+
language: true,
96+
hash: true,
97+
lineCount: true,
98+
updatedAt: true,
99+
},
100+
orderBy: { updatedAt: 'desc' },
101+
},
102+
audits: {
103+
select: {
104+
id: true,
105+
status: true,
106+
securityScore: true,
107+
createdAt: true,
108+
_count: { select: { findings: true } },
109+
},
110+
orderBy: { createdAt: 'desc' },
111+
},
112+
},
89113
});
90114

91115
if (!project) throw new NotFoundException('Project not found');

0 commit comments

Comments
 (0)