Skip to content

Commit

Permalink
fix: cast credit changes after Directus upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinKolarik committed Nov 14, 2024
1 parent d46379a commit ace6366
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pages/credits.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
})).then((additions) => {
return additions.map((addition) => {
const { sum, ...rest } = addition;
return { ...rest, amount: sum.amount };
return { ...rest, amount: Number(sum.amount) };
});
}),
$directus.request<[{sum: { amount: number }, date: 'datetime'}]>(aggregate('gp_credits_deductions', {
Expand All @@ -115,7 +115,7 @@
})).then((deduction) => {
return deduction.map((addition) => {
const { sum, ...rest } = addition;
return { ...rest, amount: sum.amount };
return { ...rest, amount: Number(sum.amount) };
});
}),
$directus.request<[{count: number}]>(aggregate('gp_adopted_probes', {
Expand Down
2 changes: 1 addition & 1 deletion pages/probes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
for (const addition of creditsAdditions) {
const { adopted_probe: adoptedProbe, sum: { amount } } = addition;
totalCredits.value += amount;
totalCredits.value += Number(amount);
creditsByProbeId[adoptedProbe] = creditsByProbeId[adoptedProbe] ? creditsByProbeId[adoptedProbe] + amount : amount;
}
Expand Down

0 comments on commit ace6366

Please sign in to comment.