From b06260d13d43fd02296cbeca244c3189876e0bea Mon Sep 17 00:00:00 2001 From: chenos Date: Fri, 18 Feb 2022 20:26:11 +0800 Subject: [PATCH] fix: field uiSchema is not updated --- packages/plugin-collection-manager/src/plugin.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/plugin-collection-manager/src/plugin.ts b/packages/plugin-collection-manager/src/plugin.ts index d7f29183e2..a0847182bb 100644 --- a/packages/plugin-collection-manager/src/plugin.ts +++ b/packages/plugin-collection-manager/src/plugin.ts @@ -50,6 +50,18 @@ export class CollectionManagerPlugin extends Plugin { this.app.on('beforeStart', async () => { await this.app.db.getRepository('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() {