️ Cache pricing data from stripe (#1237)

This commit is contained in:
Luke Vella 2024-08-03 11:03:27 +01:00 committed by GitHub
parent 9d3f2c7e08
commit d1cde59d0e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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} />;
}