From 5b61587a39bf8d8f8967bc36eeeb26c53c979f9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=87=91=E6=98=B6?= Date: Mon, 25 Jul 2022 10:41:28 +0800 Subject: [PATCH] feat: o2m delete not refresh (#646) * feat: o2m delete not refresh * feat: add TableField judgment --- packages/core/client/src/block-provider/hooks/index.ts | 7 ++++++- 1 file changed, 6 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 c06d60d48..f5b815cab 100644 --- a/packages/core/client/src/block-provider/hooks/index.ts +++ b/packages/core/client/src/block-provider/hooks/index.ts @@ -388,13 +388,18 @@ export const useUpdateActionProps = () => { export const useDestroyActionProps = () => { const filterByTk = useFilterByTk(); - const { resource, service } = useBlockRequestContext(); + const { resource, service, block, __parent } = useBlockRequestContext(); + const { setVisible } = useActionContext(); return { async onClick() { await resource.destroy({ filterByTk, }); service?.refresh?.(); + if (block !== 'TableField') { + __parent?.service?.refresh?.(); + setVisible?.(false); + } }, }; };