From 74a6d49181d2fde721869123e848e8acfba4df93 Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Fri, 20 Oct 2023 08:56:19 +0800 Subject: [PATCH] fix: record picker did not refresh list after adding data (#2877) --- packages/core/client/src/block-provider/hooks/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/core/client/src/block-provider/hooks/index.ts b/packages/core/client/src/block-provider/hooks/index.ts index a29e5d778..381ee023d 100644 --- a/packages/core/client/src/block-provider/hooks/index.ts +++ b/packages/core/client/src/block-provider/hooks/index.ts @@ -263,7 +263,7 @@ export const useCreateActionProps = () => { export const useAssociationCreateActionProps = () => { const form = useForm(); - const { field, resource } = useBlockRequestContext(); + const { field, resource, __parent } = useBlockRequestContext(); const { setVisible, fieldSchema } = useActionContext(); const actionSchema = useFieldSchema(); const actionField = useField(); @@ -345,6 +345,7 @@ export const useAssociationCreateActionProps = () => { }); actionField.data.loading = false; actionField.data.data = data; + __parent?.service?.refresh?.(); setVisible?.(false); if (!onSuccess?.successMessage) { return;