@ -75,7 +75,7 @@ export class BeforeUpdateOneField<T extends UpdateFieldInput>
|
||||
locale?: keyof typeof APP_LOCALES,
|
||||
): UpdateOneInputType<T> {
|
||||
const update: StandardFieldUpdate = {};
|
||||
const updatableFields = ['isActive', 'isLabelSyncedWithName'];
|
||||
const updatableFields = ['isActive', 'isLabelSyncedWithName', 'options'];
|
||||
const overridableFields = ['label', 'icon', 'description'];
|
||||
|
||||
const nonUpdatableFields = Object.keys(instance.update).filter(
|
||||
@ -109,6 +109,7 @@ export class BeforeUpdateOneField<T extends UpdateFieldInput>
|
||||
this.handleActiveField(instance, update);
|
||||
this.handleLabelSyncedWithNameField(instance, update);
|
||||
this.handleStandardOverrides(instance, fieldMetadata, update, locale);
|
||||
this.handleOptionsField(instance, update);
|
||||
|
||||
return {
|
||||
id: instance.id,
|
||||
@ -116,6 +117,17 @@ export class BeforeUpdateOneField<T extends UpdateFieldInput>
|
||||
};
|
||||
}
|
||||
|
||||
private handleOptionsField(
|
||||
instance: UpdateOneInputType<T>,
|
||||
update: StandardFieldUpdate,
|
||||
): void {
|
||||
if (!isDefined(instance.update.options)) {
|
||||
return;
|
||||
}
|
||||
|
||||
update.options = instance.update.options;
|
||||
}
|
||||
|
||||
private handleActiveField(
|
||||
instance: UpdateOneInputType<T>,
|
||||
update: StandardFieldUpdate,
|
||||
|
||||
Reference in New Issue
Block a user