refactor: move /report/:id route definitions together

Signed-off-by: izzy <me@insrt.uk>
This commit is contained in:
izzy
2026-02-06 16:30:57 +00:00
parent 7e5ab25418
commit 3d5db67656

View File

@@ -46,6 +46,22 @@ export class IntegrityController {
return this.service.getIntegrityReport(dto);
}
@Get('report/:id/file')
@Endpoint({
summary: 'Download flagged file',
description: 'Download the untracked/broken file if one exists',
history: new HistoryBuilder().added('v2.6.0').alpha('v2.6.0'),
})
@FileResponse()
@Authenticated({ permission: Permission.Maintenance, admin: true })
async getIntegrityReportFile(
@Param() { id }: UUIDv7ParamDto,
@Res() res: Response,
@Next() next: NextFunction,
): Promise<void> {
await sendFile(res, next, () => this.service.getIntegrityReportFile(id), this.logger);
}
@Delete('report/:id')
@Endpoint({
summary: 'Delete integrity report item',
@@ -72,20 +88,4 @@ export class IntegrityController {
this.service.getIntegrityReportCsv(type).pipe(res);
}
@Get('report/:id/file')
@Endpoint({
summary: 'Download flagged file',
description: 'Download the untracked/broken file if one exists',
history: new HistoryBuilder().added('v2.6.0').alpha('v2.6.0'),
})
@FileResponse()
@Authenticated({ permission: Permission.Maintenance, admin: true })
async getIntegrityReportFile(
@Param() { id }: UUIDv7ParamDto,
@Res() res: Response,
@Next() next: NextFunction,
): Promise<void> {
await sendFile(res, next, () => this.service.getIntegrityReportFile(id), this.logger);
}
}