diff --git a/.circleci/config.yml b/.circleci/config.yml index 2c5ccb534f..1e37ab4b7a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -357,7 +357,7 @@ workflows: filters: branches: only: - - free + - referral-api-bug # This is beta env for production soft releases - "build-prod-beta": context : org-global diff --git a/src/server/services/recruitCRM.js b/src/server/services/recruitCRM.js index e5bb7d2b90..220b3d0f8b 100644 --- a/src/server/services/recruitCRM.js +++ b/src/server/services/recruitCRM.js @@ -385,20 +385,20 @@ export default class RecruitCRMService { // candidate exists in growsurf // update candidate to set referrer only if it is not set already if (!existRes.referrer) { - growRes = await gs.updateParticipant(form.email, JSON.stringify({ + growRes = await gs.updateParticipant(form.email, { referredBy: referralCookie.referralId, referralStatus: 'CREDIT_PENDING', metadata: { gigID: id, }, - })); + }); // add referral link to candidate profile in recruitCRM if (!growRes.error) { isReferred = true; form.custom_fields.push({ field_id: 6, value: `https://app.growsurf.com/dashboard/campaign/${config.GROWSURF_CAMPAIGN_ID}/participant/${growRes.id}`, }); - } + } else notifyKirilAndNick(growRes); } } else { growRes = await gs.addParticipant(JSON.stringify({ @@ -418,7 +418,7 @@ export default class RecruitCRMService { form.custom_fields.push({ field_id: 6, value: `https://app.growsurf.com/dashboard/campaign/${config.GROWSURF_CAMPAIGN_ID}/participant/${growRes.id}`, }); - } + } else notifyKirilAndNick(growRes); } // finally, clear the cookie res.cookie(config.GROWSURF_COOKIE, '', {