From 8e96d8e48d51655baaeec3c61a12d4d861153c1a Mon Sep 17 00:00:00 2001 From: Stefan Moraru Date: Wed, 23 Oct 2024 11:08:34 +0300 Subject: [PATCH] fix(plan creation): do not pass cascadeUpdates if it is undefined --- src/core/serializers/serializePlanInput.ts | 2 +- src/hooks/plans/usePlanForm.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/serializers/serializePlanInput.ts b/src/core/serializers/serializePlanInput.ts index e7730ce8d..58706a114 100644 --- a/src/core/serializers/serializePlanInput.ts +++ b/src/core/serializers/serializePlanInput.ts @@ -192,7 +192,7 @@ export const serializePlanInput = (values: PlanFormInput) => { } }, ), - cascadeUpdates, + ...(typeof cascadeUpdates === 'undefined' ? {} : { cascadeUpdates }), ...otherValues, } } diff --git a/src/hooks/plans/usePlanForm.tsx b/src/hooks/plans/usePlanForm.tsx index 50df06383..e423afc6a 100644 --- a/src/hooks/plans/usePlanForm.tsx +++ b/src/hooks/plans/usePlanForm.tsx @@ -230,7 +230,7 @@ export const usePlanForm: ({ }), ) as LocalChargeInput[]) : ([] as LocalChargeInput[]), - cascadeUpdates: false, + cascadeUpdates: undefined, }, validationSchema: object().shape({ name: string().required(''),