mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
fix: accept UUIDv7 in URL param
This commit is contained in:
@@ -13,7 +13,7 @@ import { Auth, Authenticated, FileResponse } from 'src/middleware/auth.guard';
|
|||||||
import { LoggingRepository } from 'src/repositories/logging.repository';
|
import { LoggingRepository } from 'src/repositories/logging.repository';
|
||||||
import { IntegrityService } from 'src/services/integrity.service';
|
import { IntegrityService } from 'src/services/integrity.service';
|
||||||
import { sendFile } from 'src/utils/file';
|
import { sendFile } from 'src/utils/file';
|
||||||
import { IntegrityReportTypeParamDto, UUIDParamDto } from 'src/validation';
|
import { IntegrityReportTypeParamDto, UUIDv7ParamDto } from 'src/validation';
|
||||||
|
|
||||||
@ApiTags(ApiTag.Maintenance)
|
@ApiTags(ApiTag.Maintenance)
|
||||||
@Controller('admin/integrity')
|
@Controller('admin/integrity')
|
||||||
@@ -53,7 +53,7 @@ export class IntegrityController {
|
|||||||
history: new HistoryBuilder().added('v9.9.9').alpha('v9.9.9'),
|
history: new HistoryBuilder().added('v9.9.9').alpha('v9.9.9'),
|
||||||
})
|
})
|
||||||
@Authenticated({ permission: Permission.Maintenance, admin: true })
|
@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);
|
await this.service.deleteIntegrityReport(auth, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ export class IntegrityController {
|
|||||||
@FileResponse()
|
@FileResponse()
|
||||||
@Authenticated({ permission: Permission.Maintenance, admin: true })
|
@Authenticated({ permission: Permission.Maintenance, admin: true })
|
||||||
async getIntegrityReportFile(
|
async getIntegrityReportFile(
|
||||||
@Param() { id }: UUIDParamDto,
|
@Param() { id }: UUIDv7ParamDto,
|
||||||
@Res() res: Response,
|
@Res() res: Response,
|
||||||
@Next() next: NextFunction,
|
@Next() next: NextFunction,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
|
|||||||
@@ -89,6 +89,13 @@ export class UUIDParamDto {
|
|||||||
id!: string;
|
id!: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class UUIDv7ParamDto {
|
||||||
|
@IsNotEmpty()
|
||||||
|
@IsUUID('7')
|
||||||
|
@ApiProperty({ format: 'uuid' })
|
||||||
|
id!: string;
|
||||||
|
}
|
||||||
|
|
||||||
export class UUIDAssetIDParamDto {
|
export class UUIDAssetIDParamDto {
|
||||||
@ValidateUUID()
|
@ValidateUUID()
|
||||||
id!: string;
|
id!: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user