Skip to content

Commit 7000c2a

Browse files
committed
Add the required fields to the initial SQL query
1 parent bf97c4f commit 7000c2a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/routes/billingAccounts/get.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module.exports = [
4242
}
4343
const { accessToken, instanceUrl } = await SalesforceService.authenticate();
4444
// eslint-disable-next-line
45-
const sql = `SELECT TopCoder_Billing_Account_Id__c, Mark_Up__c, Active__c from Topcoder_Billing_Account__c tba where TopCoder_Billing_Account_Id__c='${billingAccountId}'`;
45+
const sql = `SELECT TopCoder_Billing_Account_Id__c, Mark_Up__c, Active__c, Start_Date__c, End_Date__c from Topcoder_Billing_Account__c tba where TopCoder_Billing_Account_Id__c='${billingAccountId}'`;
4646
req.log.debug(sql);
4747
const billingAccount = await SalesforceService.queryBillingAccount(sql, accessToken, instanceUrl, req.log);
4848
const isMachineToken = _.get(req, 'authUser.isMachine', false);

src/services/salesforceService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ class SalesforceService {
103103
),
104104
markup: _.get(o, config.get('sfdcBillingAccountMarkupField')),
105105
active: _.get(o, config.get('sfdcBillingAccountActiveField')),
106-
startDate: _.get(o, 'Topcoder_Billing_Account__r.Start_Date__c'),
107-
endDate: _.get(o, 'Topcoder_Billing_Account__r.End_Date__c'),
106+
startDate: _.get(o, 'Start_Date__c'),
107+
endDate: _.get(o, 'End_Date__c'),
108108
}));
109109
return billingAccounts.length > 0 ? billingAccounts[0] : {};
110110
});

0 commit comments

Comments
 (0)