mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
refactor: move /report/:id route definitions together
Signed-off-by: izzy <me@insrt.uk>
This commit is contained in:
@@ -46,6 +46,22 @@ export class IntegrityController {
|
|||||||
return this.service.getIntegrityReport(dto);
|
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')
|
@Delete('report/:id')
|
||||||
@Endpoint({
|
@Endpoint({
|
||||||
summary: 'Delete integrity report item',
|
summary: 'Delete integrity report item',
|
||||||
@@ -72,20 +88,4 @@ export class IntegrityController {
|
|||||||
|
|
||||||
this.service.getIntegrityReportCsv(type).pipe(res);
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user