Skip to content

Commit

Permalink
salesloft -- properly fix adding custom fields (move to the right level)
Browse files Browse the repository at this point in the history
  • Loading branch information
williamstein committed Feb 27, 2024
1 parent a15532d commit 8df1d05
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/packages/server/salesloft/money.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export async function updateMoney(cutoff: string = "2 days") {
}
const data = await getMoneyData(account_id);
log.debug("updateMoney: ", { salesloft_id: id, account_id, data });
await update(id, data);
await update(id, { custom_fields: data });
}
}

Expand All @@ -79,12 +79,10 @@ export async function getMoneyData(account_id: string): Promise<{
if (x.rows.length == 0) {
// no statements ever
return {
custom_fields: {
cocalc_balance: 0,
cocalc_purchase_timestamp: "0000-00-00T00:00:00.000Z",
cocalc_last_month_spend: 0,
cocalc_last_year_spend: 0,
},
cocalc_balance: 0,
cocalc_purchase_timestamp: "0000-00-00T00:00:00.000Z",
cocalc_last_month_spend: 0,
cocalc_last_year_spend: 0,
};
}
const cocalc_balance = x.rows[0].balance;
Expand Down

0 comments on commit 8df1d05

Please sign in to comment.