Skip to content

Commit 9391f10

Browse files
committed
Fix: Show the summation of the graph, not the totals
1 parent bd4a17d commit 9391f10

File tree

1 file changed

+14
-2
lines changed
  • src/routes/(console)/organization-[organization]/usage/[[invoice]]

1 file changed

+14
-2
lines changed

src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,20 @@
3131
$: projects = (data.organizationUsage as OrganizationUsage).projects;
3232
3333
$: legendData = [
34-
{ name: 'Reads', value: data.organizationUsage.databasesReadsTotal },
35-
{ name: 'Writes', value: data.organizationUsage.databasesWritesTotal }
34+
{
35+
name: 'Reads',
36+
value: data.organizationUsage.databasesReads.reduce(
37+
(sum, singleDay) => sum + singleDay.value,
38+
0
39+
)
40+
},
41+
{
42+
name: 'Writes',
43+
value: data.organizationUsage.databasesWrites.reduce(
44+
(sum, singleDay) => sum + singleDay.value,
45+
0
46+
)
47+
}
3648
];
3749
</script>
3850

0 commit comments

Comments
 (0)