diff --git a/server/src/controllers/integrity.controller.ts b/server/src/controllers/integrity.controller.ts index 9d455e3c68..973afe7ef2 100644 --- a/server/src/controllers/integrity.controller.ts +++ b/server/src/controllers/integrity.controller.ts @@ -13,7 +13,7 @@ import { Auth, Authenticated, FileResponse } from 'src/middleware/auth.guard'; import { LoggingRepository } from 'src/repositories/logging.repository'; import { IntegrityService } from 'src/services/integrity.service'; import { sendFile } from 'src/utils/file'; -import { IntegrityReportTypeParamDto, UUIDParamDto } from 'src/validation'; +import { IntegrityReportTypeParamDto, UUIDv7ParamDto } from 'src/validation'; @ApiTags(ApiTag.Maintenance) @Controller('admin/integrity') @@ -53,7 +53,7 @@ export class IntegrityController { history: new HistoryBuilder().added('v9.9.9').alpha('v9.9.9'), }) @Authenticated({ permission: Permission.Maintenance, admin: true }) - async deleteIntegrityReport(@Auth() auth: AuthDto, @Param() { id }: UUIDParamDto): Promise { + async deleteIntegrityReport(@Auth() auth: AuthDto, @Param() { id }: UUIDv7ParamDto): Promise { await this.service.deleteIntegrityReport(auth, id); } @@ -82,7 +82,7 @@ export class IntegrityController { @FileResponse() @Authenticated({ permission: Permission.Maintenance, admin: true }) async getIntegrityReportFile( - @Param() { id }: UUIDParamDto, + @Param() { id }: UUIDv7ParamDto, @Res() res: Response, @Next() next: NextFunction, ): Promise { diff --git a/server/src/validation.ts b/server/src/validation.ts index da5033dc32..198f344faa 100644 --- a/server/src/validation.ts +++ b/server/src/validation.ts @@ -89,6 +89,13 @@ export class UUIDParamDto { id!: string; } +export class UUIDv7ParamDto { + @IsNotEmpty() + @IsUUID('7') + @ApiProperty({ format: 'uuid' }) + id!: string; +} + export class UUIDAssetIDParamDto { @ValidateUUID() id!: string;