update billing types

This commit is contained in:
Ramnique Singh 2025-08-23 09:59:14 +05:30
parent 219d4c7901
commit b49e14fdf8
9 changed files with 37 additions and 26 deletions

View file

@ -8,7 +8,6 @@ import { z } from "zod";
import { tokens } from "@/app/styles/design-tokens";
import { SectionHeading } from "@/components/ui/section-heading";
import { HorizontalDivider } from "@/components/ui/horizontal-divider";
import { WithStringId } from "@/app/lib/types/types";
import clsx from 'clsx';
import { getCustomerPortalUrl } from "../actions/billing.actions";
import { useState } from "react";
@ -31,7 +30,7 @@ const planDetails = {
};
interface BillingPageProps {
customer: WithStringId<z.infer<typeof Customer>>;
customer: z.infer<typeof Customer>;
usage: z.infer<typeof UsageResponse>;
}

View file

@ -13,7 +13,7 @@ export default async function Page(
) {
const searchParams = await props.searchParams;
const customer = await requireBillingCustomer();
await syncWithStripe(customer._id);
await syncWithStripe(customer.id);
const redirectUrl = searchParams.redirect as string;
redirect(redirectUrl || '/projects');
}

View file

@ -12,6 +12,6 @@ export default async function Page() {
}
const customer = await requireBillingCustomer();
const usage = await getUsage(customer._id);
const usage = await getUsage(customer.id);
return <BillingPage customer={customer} usage={usage} />;
}