Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lib/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export const PAGE_LIMIT = 12; // default page limit
export const SPREADSHEET_PAGE_LIMIT = 50; // default sheet page limit
export const CARD_LIMIT = 6; // default card limit
export const DEFAULT_BILLING_PROJECTS_LIMIT = 5; // default billing projects page limit
export const INTERVAL = 5 * 60000; // default interval to check for feedback
export const NEW_DEV_PRO_UPGRADE_COUPON = 'appw50';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BillingPlan, Dependencies } from '$lib/constants';
import { BillingPlan, DEFAULT_BILLING_PROJECTS_LIMIT, Dependencies } from '$lib/constants';
import type { Address } from '$lib/sdk/billing';
import { type Organization } from '$lib/stores/organization';
import { sdk } from '$lib/stores/sdk';
Expand Down Expand Up @@ -39,7 +39,7 @@ export const load: PageLoad = async ({ parent, depends, url, route }) => {
let billingAggregation = null;
try {
const currentPage = getPage(url) || 1;
const limit = getLimit(url, route, 5);
const limit = getLimit(url, route, DEFAULT_BILLING_PROJECTS_LIMIT);
const offset = pageToOffset(currentPage, limit);
billingAggregation = await sdk.forConsole.billing.getAggregation(
organization.$id,
Expand Down Expand Up @@ -94,8 +94,10 @@ export const load: PageLoad = async ({ parent, depends, url, route }) => {
countryList,
locale,
nextPlan: billingPlanDowngrade,
// expose pagination for components
limit: getLimit(url, route, 5),
offset: pageToOffset(getPage(url) || 1, getLimit(url, route, 5))
limit: getLimit(url, route, DEFAULT_BILLING_PROJECTS_LIMIT),
offset: pageToOffset(
getPage(url) || 1,
getLimit(url, route, DEFAULT_BILLING_PROJECTS_LIMIT)
)
};
};
Loading
Loading