diff --git a/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte b/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte index 82c211c19..636f88fdd 100644 --- a/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte +++ b/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte @@ -143,7 +143,6 @@ Users

The total number of users across all projects in your organization.

- {#if data.organizationUsage.users} {@const current = data.organizationUsage.usersTotal} @@ -169,7 +168,7 @@ { name: 'Users', data: accumulateFromEndingTotal( - data.organizationUsage.users, + data.usersUsageToDate, data.organizationUsage.usersTotal ) } diff --git a/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.ts b/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.ts index 9ffafbac2..74dffcda2 100644 --- a/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.ts +++ b/src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.ts @@ -72,12 +72,15 @@ export const load: PageLoad = async ({ params, parent }) => { } } + const usersUsageToDate = usage.users.filter((user) => new Date(user.date) < new Date()); + return { organizationUsage: usage, projectNames, invoices, currentInvoice, organizationMembers, - plan + plan, + usersUsageToDate }; };