Invalidate the form query on toggle to update toggle state in UI (#8325)

This commit is contained in:
Hariom Balhara authored and GitHub committed 2023-04-17 17:34:25 +05:30
1 parent 45b5b2a376
commit b6e1989f17
1 file changed
+6 -1
@@ -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) {