Skip to content

Commit

Permalink
Update campaignUtils.ts (#884)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashish-egov authored Jun 14, 2024
1 parent b3dffab commit 02319cf
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion utilities/project-factory/src/server/utils/campaignUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,16 @@ function removeBoundariesFromRequest(request: any) {
}
}

async function enrichAndPersistProjectCampaignForFirst(request: any, actionInUrl: any, firstPersist: boolean = false, localizationMap?: any) {
removeBoundariesFromRequest(request);
if (actionInUrl == "create") {
await enrichAndPersistCampaignForCreate(request, firstPersist)
}
else if (actionInUrl == "update") {
await enrichAndPersistCampaignForUpdate(request, firstPersist)
}
}


async function enrichAndPersistProjectCampaignRequest(request: any, actionInUrl: any, firstPersist: boolean = false, localizationMap?: any) {
var createResourceDetailsIds: any[] = []
Expand Down Expand Up @@ -1326,7 +1336,7 @@ async function processBasedOnAction(request: any, actionInUrl: any) {
if (actionInUrl == "create") {
request.body.CampaignDetails.id = uuidv4()
}
await enrichAndPersistProjectCampaignRequest(request, actionInUrl, true)
await enrichAndPersistProjectCampaignForFirst(request, actionInUrl, true)
processAfterPersist(request, actionInUrl)
}

Expand Down

0 comments on commit 02319cf

Please sign in to comment.