fix: field uiSchema is not updated

This commit is contained in:
chenos 2022-02-18 20:26:11 +08:00
parent b9bbbc8516
commit b06260d13d

View File

@ -50,6 +50,18 @@ export class CollectionManagerPlugin extends Plugin {
this.app.on('beforeStart', async () => {
await this.app.db.getRepository<CollectionRepository>('collections').load();
});
this.app.resourcer.use(async (ctx, next) => {
const { resourceName, actionName } = ctx.action;
if (resourceName === 'collections.fields' && actionName === 'update') {
const { updateAssociationValues = [] } = ctx.action.params;
updateAssociationValues.push('uiSchema');
ctx.action.mergeParams({
updateAssociationValues,
});
}
await next();
});
}
async load() {