mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-31 09:46:26 +02:00
⚡️ Cache pricing data from stripe (#1237)
This commit is contained in:
parent
9d3f2c7e08
commit
d1cde59d0e
1 changed files with 4 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
import { getProPricing } from "@rallly/billing";
|
||||
import { unstable_cache } from "next/cache";
|
||||
import { notFound } from "next/navigation";
|
||||
|
||||
import { BillingPage } from "@/app/[locale]/(admin)/settings/billing/billing-page";
|
||||
|
@ -6,11 +7,13 @@ import { Params } from "@/app/[locale]/types";
|
|||
import { getTranslation } from "@/app/i18n";
|
||||
import { env } from "@/env";
|
||||
|
||||
const getCachedProPricing = unstable_cache(getProPricing, ["pricing-data"]);
|
||||
|
||||
export default async function Page() {
|
||||
if (env.NEXT_PUBLIC_SELF_HOSTED === "true") {
|
||||
notFound();
|
||||
}
|
||||
const prices = await getProPricing();
|
||||
const prices = await getCachedProPricing();
|
||||
return <BillingPage pricingData={prices} />;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue