Fix error page on usage

This commit is contained in:
Matej Bačo committed 2023-12-19 20:38:53 +01:00
1 parent 499d5455f5
commit 41e8f11245
1 file changed
+8 -4
@@ -41,12 +41,16 @@ export const load: PageLoad = async ({ params, parent }) => {
sdk.forConsole.billing.listUsage(params.organization, startDate, endDate)
]);
const projectNames = await sdk.forConsole.projects.list([
Query.equal(
const queries: string[] = [];
if(usage.projects.length > 0) {
queries.push(Query.equal(
'$id',
usage.projects.map((p) => p.projectId)
)
]);
));
}
const projectNames = await sdk.forConsole.projects.list(queries);
return {
organizationUsage: usage,