Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2d75db9

Browse files
committed
debug: add additional console logs for score calculations and updated custom fields in ScoreCampaigns
1 parent 6770877 commit 2d75db9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/plugin-loyalties-api/src/models/ScoreCampaigns.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,13 +355,16 @@ export const loadScoreCampaignClass = (models: IModels, subdomain: string) => {
355355

356356
let oldScore = score;
357357

358+
console.log({ customFieldsData,score ,changeScore });
358359
if (campaign.fieldId) {
359360
const fieldScore =
360361
customFieldsData.find(({ field }) => field === campaign.fieldId)
361362
?.value || 0;
362363
oldScore = fieldScore;
363364
}
364365

366+
console.log({ oldScore });
367+
365368
const newScore =
366369
actionMethod === "subtract"
367370
? oldScore - changeScore
@@ -399,12 +402,14 @@ export const loadScoreCampaignClass = (models: IModels, subdomain: string) => {
399402
);
400403
}
401404

405+
console.log({ updatedCustomFieldsData, });
406+
402407
await this.updateOwnerScore({
403408
ownerId,
404409
ownerType,
405410
updatedCustomFieldsData,
406411
});
407-
412+
console.log("score log");
408413
return await models.ScoreLogs.create({
409414
ownerId,
410415
ownerType,

0 commit comments

Comments
 (0)