fix: accept UUIDv7 in URL param

This commit is contained in:
izzy
2026-01-07 13:01:46 +00:00
parent 5f35abbaa5
commit 7f8b0772a9
2 changed files with 10 additions and 3 deletions

View File

@@ -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<void> {
async deleteIntegrityReport(@Auth() auth: AuthDto, @Param() { id }: UUIDv7ParamDto): Promise<void> {
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<void> {

View File

@@ -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;