|
1 | | -import { BillingPlan, Dependencies } from '$lib/constants'; |
| 1 | +import { BillingPlan, DEFAULT_BILLING_PROJECTS_LIMIT, Dependencies } from '$lib/constants'; |
2 | 2 | import type { Address } from '$lib/sdk/billing'; |
3 | 3 | import { type Organization } from '$lib/stores/organization'; |
4 | 4 | import { sdk } from '$lib/stores/sdk'; |
@@ -39,7 +39,7 @@ export const load: PageLoad = async ({ parent, depends, url, route }) => { |
39 | 39 | let billingAggregation = null; |
40 | 40 | try { |
41 | 41 | const currentPage = getPage(url) || 1; |
42 | | - const limit = getLimit(url, route, 5); |
| 42 | + const limit = getLimit(url, route, DEFAULT_BILLING_PROJECTS_LIMIT); |
43 | 43 | const offset = pageToOffset(currentPage, limit); |
44 | 44 | billingAggregation = await sdk.forConsole.billing.getAggregation( |
45 | 45 | organization.$id, |
@@ -94,8 +94,10 @@ export const load: PageLoad = async ({ parent, depends, url, route }) => { |
94 | 94 | countryList, |
95 | 95 | locale, |
96 | 96 | nextPlan: billingPlanDowngrade, |
97 | | - // expose pagination for components |
98 | | - limit: getLimit(url, route, 5), |
99 | | - offset: pageToOffset(getPage(url) || 1, getLimit(url, route, 5)) |
| 97 | + limit: getLimit(url, route, DEFAULT_BILLING_PROJECTS_LIMIT), |
| 98 | + offset: pageToOffset( |
| 99 | + getPage(url) || 1, |
| 100 | + getLimit(url, route, DEFAULT_BILLING_PROJECTS_LIMIT) |
| 101 | + ) |
100 | 102 | }; |
101 | 103 | }; |
0 commit comments