Fix monthly totals erroring out when updating records
This commit is contained in:
parent
6136dace7c
commit
5aa8144ad5
1
index.js
1
index.js
|
@ -104,6 +104,7 @@ function updateRecords(callStats, records) {
|
|||
records.totalCallsEverPlaced = callStats.totalCallsEverPlaced;
|
||||
|
||||
// Update monthly totals
|
||||
if (!records.monthlyTotals) records.monthlyTotals = {};
|
||||
records.monthlyTotals[yesterday.getFullYear().toString()][yesterday.getMonth().toString()] = callStats.totalCallsThisMonth;
|
||||
|
||||
if (isNewRecord) {
|
||||
|
|
Loading…
Reference in a new issue