Skip to content

Commit

Permalink
added isprojectDateUpdateFlag (#1274)
Browse files Browse the repository at this point in the history
* added isprojectDateUpdateFlag

* Update useProjectUpdateWithBoundary.js

---------

Co-authored-by: Jagankumar <[email protected]>
  • Loading branch information
Bhavya-egov and jagankumar-egov authored Aug 13, 2024
1 parent d5b9fa6 commit 6f08f64
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -118,6 +118,7 @@ function UpdateDatesWithBoundaries() {
url: "/health-project/v1/_update",
body: {
Projects: [formData?.dateAndCycle],
isCascadingProjectDateUpdate: true,
},
});
// setShowToast({ isError: false, label: "DATE_UPDATED_SUCCESSFULLY" });
Expand Down

0 comments on commit 6f08f64

Please sign in to comment.