mirror of
https://github.com/immich-app/immich.git
synced 2026-02-20 18:20:21 -05:00
feat: editing descriminator (#26336)
This commit is contained in:
parent
fd0338f89c
commit
72a5ccaa53
@ -16117,7 +16117,15 @@
|
||||
{
|
||||
"$ref": "#/components/schemas/AssetEditActionMirror"
|
||||
}
|
||||
]
|
||||
],
|
||||
"discriminator": {
|
||||
"mapping": {
|
||||
"crop": "#/components/schemas/AssetEditActionCrop",
|
||||
"mirror": "#/components/schemas/AssetEditActionMirror",
|
||||
"rotate": "#/components/schemas/AssetEditActionRotate"
|
||||
},
|
||||
"propertyName": "action"
|
||||
}
|
||||
},
|
||||
"minItems": 1,
|
||||
"type": "array"
|
||||
@ -16188,7 +16196,15 @@
|
||||
{
|
||||
"$ref": "#/components/schemas/AssetEditActionMirror"
|
||||
}
|
||||
]
|
||||
],
|
||||
"discriminator": {
|
||||
"mapping": {
|
||||
"crop": "#/components/schemas/AssetEditActionCrop",
|
||||
"mirror": "#/components/schemas/AssetEditActionMirror",
|
||||
"rotate": "#/components/schemas/AssetEditActionRotate"
|
||||
},
|
||||
"propertyName": "action"
|
||||
}
|
||||
},
|
||||
"minItems": 1,
|
||||
"type": "array"
|
||||
|
||||
@ -118,7 +118,15 @@ export class AssetEditActionListDto {
|
||||
Array.isArray(edits) ? edits.map((item) => plainToInstance(getActionClass(item), item)) : edits,
|
||||
)
|
||||
@ApiProperty({
|
||||
anyOf: Object.values(actionToClass).map((target) => ({ $ref: getSchemaPath(target) })),
|
||||
items: {
|
||||
anyOf: Object.values(actionToClass).map((type) => ({ $ref: getSchemaPath(type) })),
|
||||
discriminator: {
|
||||
propertyName: 'action',
|
||||
mapping: Object.fromEntries(
|
||||
Object.entries(actionToClass).map(([action, type]) => [action, getSchemaPath(type)]),
|
||||
),
|
||||
},
|
||||
},
|
||||
description: 'List of edit actions to apply (crop, rotate, or mirror)',
|
||||
})
|
||||
edits!: AssetEditActionItem[];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user