diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/hooks/useProjectUpdateWithBoundary.js b/health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/hooks/useProjectUpdateWithBoundary.js index 330c0179fb1..326bf00f3f4 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/hooks/useProjectUpdateWithBoundary.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/hooks/useProjectUpdateWithBoundary.js @@ -1,9 +1,10 @@ const useProjectUpdateWithBoundary = async ({ formData }) => { const requests = formData.map((item) => { return Digit.CustomService.getResponse({ - url: "/health-project/v1/_update", + url: "/health-project/v1/_update", // todo should be picked up from globalconfig body: { Projects: [item], + isCascadingProjectDateUpdate: true, }, }).then((res) => { return res; diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/UpdateDatesWithBoundaries.js b/health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/UpdateDatesWithBoundaries.js index 78da60f5076..c193dc3f0d6 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/UpdateDatesWithBoundaries.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/UpdateDatesWithBoundaries.js @@ -92,19 +92,19 @@ function UpdateDatesWithBoundaries() { let itemEndDate = item?.endDate; let endDate = new Date(item?.endDate); let endSecond = endDate?.getSeconds(); - if (endSecond < 59) { - return { - ...item, - endDate: itemEndDate + 1000, - }; - } else { - return { - ...item, - endDate: itemEndDate - 1000, - }; - } + // if (endSecond < 59) { + // return { + // ...item, + // endDate: itemEndDate + 1000, + // }; + // } else { + // return { + // ...item, + // endDate: itemEndDate - 1000, + // }; + // } }); - const temp = await Digit.Hooks.campaign.useProjectUpdateWithBoundary({ formData: payload }); + const temp = await Digit.Hooks.campaign.useProjectUpdateWithBoundary({ formData: formData?.dateWithBoundary }); // setShowToast({ isError: false, label: "DATE_UPDATED_SUCCESSFULLY" }); history.push(`/${window.contextPath}/employee/campaign/response?isSuccess=${true}`, { message: t("ES_CAMPAIGN_DATE_CHANGE_WITH_BOUNDARY_SUCCESS"), @@ -118,6 +118,7 @@ function UpdateDatesWithBoundaries() { url: "/health-project/v1/_update", body: { Projects: [formData?.dateAndCycle], + isCascadingProjectDateUpdate: true, }, }); // setShowToast({ isError: false, label: "DATE_UPDATED_SUCCESSFULLY" });