-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
console recent changes to merged in master #1274
base: master
Are you sure you want to change the base?
Changes from 1 commit
355a8ab
2bdd736
016dc01
d96bb2b
19283e0
74700da
9dee69b
3ed33e6
49b5801
b373ac4
b69ba14
ad9a5b8
f13f4cf
9df4256
d832441
fc6122e
bfccb0a
5420d8e
bd673e7
97b4b32
b5be48e
396673c
3fc3a41
343393e
d94b380
b5aee12
0b7cdfb
8107a82
faba517
23330be
b4fa23b
78f1eef
b1eb7fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -958,7 +958,7 @@ async function enrichAndPersistCampaignWithError(requestBody: any, error: any) { | |
requestBody.CampaignDetails.status = campaignStatuses?.failed; | ||
// requestBody.CampaignDetails.isActive = false; | ||
requestBody.CampaignDetails.boundaryCode = | ||
getRootBoundaryCode(requestBody?.CampaignDetails?.boundaries) || null; | ||
getRootBoundaryCode(requestBody?.boundariesCombined) || null; | ||
requestBody.CampaignDetails.projectType = | ||
requestBody?.CampaignDetails?.projectType || null; | ||
requestBody.CampaignDetails.hierarchyType = | ||
|
@@ -1035,7 +1035,7 @@ async function enrichAndPersistCampaignForCreate( | |
request.body.CampaignDetails.status = | ||
action == "create" ? campaignStatuses.started : campaignStatuses.drafted; | ||
request.body.CampaignDetails.boundaryCode = getRootBoundaryCode( | ||
request.body.boundariesCombined | ||
request.body?.boundariesCombined | ||
); | ||
request.body.CampaignDetails.projectType = | ||
request?.body?.CampaignDetails?.projectType || null; | ||
|
@@ -1111,7 +1111,7 @@ async function enrichAndPersistCampaignForUpdate( | |
? campaignStatuses.started | ||
: campaignStatuses.drafted; | ||
const boundaryCode = !request?.body?.CampaignDetails?.projectId | ||
? getRootBoundaryCode(request.body.CampaignDetails.boundaries) | ||
? getRootBoundaryCode(request.body?.boundariesCombined) | ||
: request?.body?.CampaignDetails?.boundaryCode || | ||
ExistingCampaignDetails?.boundaryCode; | ||
request.body.CampaignDetails.boundaryCode = boundaryCode; | ||
|
@@ -2414,6 +2414,7 @@ async function processAfterPersist(request: any, actionInUrl: any) { | |
localizationMap | ||
); | ||
} | ||
delete request.body?.boundariesCombined; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Avoid using the Deleting properties from objects can negatively impact performance. Consider setting the property to Apply this diff: - delete request.body?.boundariesCombined;
+ request.body.boundariesCombined = undefined;
🧰 Tools🪛 Biome (1.9.4)[error] 2417-2417: Avoid the delete operator which can impact performance. (lint/performance/noDelete) |
||
} catch (error: any) { | ||
console.log(error); | ||
logger.error(error); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Consider improving readability of the boundary code logic.
The nested ternary operator could be simplified for better readability.
Consider this alternative: