fix: record picker did not refresh list after adding data (#2877)

This commit is contained in:
katherinehhh 2023-10-20 08:56:19 +08:00 committed by GitHub
parent 0be4e6d94d
commit 74a6d49181
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -263,7 +263,7 @@ export const useCreateActionProps = () => {
export const useAssociationCreateActionProps = () => { export const useAssociationCreateActionProps = () => {
const form = useForm(); const form = useForm();
const { field, resource } = useBlockRequestContext(); const { field, resource, __parent } = useBlockRequestContext();
const { setVisible, fieldSchema } = useActionContext(); const { setVisible, fieldSchema } = useActionContext();
const actionSchema = useFieldSchema(); const actionSchema = useFieldSchema();
const actionField = useField(); const actionField = useField();
@ -345,6 +345,7 @@ export const useAssociationCreateActionProps = () => {
}); });
actionField.data.loading = false; actionField.data.loading = false;
actionField.data.data = data; actionField.data.data = data;
__parent?.service?.refresh?.();
setVisible?.(false); setVisible?.(false);
if (!onSuccess?.successMessage) { if (!onSuccess?.successMessage) {
return; return;