Invalidate the form query on toggle to update toggle state in UI (#8325)
parent
45b5b2a376
commit
b6e1989f17
|
@ -276,8 +276,13 @@ export function FormActionsProvider({ appUrl, children }: { appUrl: string; chil
|
||||||
}
|
}
|
||||||
return { previousValue };
|
return { previousValue };
|
||||||
},
|
},
|
||||||
onSettled: () => {
|
onSettled: (routingForm) => {
|
||||||
utils.viewer.appRoutingForms.forms.invalidate();
|
utils.viewer.appRoutingForms.forms.invalidate();
|
||||||
|
if (routingForm) {
|
||||||
|
utils.viewer.appRoutingForms.formQuery.invalidate({
|
||||||
|
id: routingForm.id,
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onError: (err, value, context) => {
|
onError: (err, value, context) => {
|
||||||
if (context?.previousValue) {
|
if (context?.previousValue) {
|
||||||
|
|
Loading…
Reference in New Issue