From b6e1989f17b0a850acc5e29f47b6301d09f6f9ed Mon Sep 17 00:00:00 2001 From: Hariom Balhara Date: Mon, 17 Apr 2023 17:34:25 +0530 Subject: [PATCH] Invalidate the form query on toggle to update toggle state in UI (#8325) --- .../app-store/routing-forms/components/FormActions.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/app-store/routing-forms/components/FormActions.tsx b/packages/app-store/routing-forms/components/FormActions.tsx index e733ac620f..7d84059335 100644 --- a/packages/app-store/routing-forms/components/FormActions.tsx +++ b/packages/app-store/routing-forms/components/FormActions.tsx @@ -276,8 +276,13 @@ export function FormActionsProvider({ appUrl, children }: { appUrl: string; chil } return { previousValue }; }, - onSettled: () => { + onSettled: (routingForm) => { utils.viewer.appRoutingForms.forms.invalidate(); + if (routingForm) { + utils.viewer.appRoutingForms.formQuery.invalidate({ + id: routingForm.id, + }); + } }, onError: (err, value, context) => { if (context?.previousValue) {