add migration

This commit is contained in:
miloschwartz
2025-04-28 23:07:11 -04:00
parent 81adcd9234
commit 3ebc01df8c
5 changed files with 4128 additions and 1461 deletions

View File

@@ -28,7 +28,7 @@ export function SitePriceCalculator({
onOpenChange,
mode
}: SitePriceCalculatorProps) {
const [siteCount, setSiteCount] = useState(1);
const [siteCount, setSiteCount] = useState(3);
const pricePerSite = 5;
const licenseFlatRate = 125;

View File

@@ -7,6 +7,10 @@ import { Metadata } from "next";
import { redirect } from "next/navigation";
import { cache } from "react";
import { rootNavItems } from "../navigation";
import { ListUserOrgsResponse } from "@server/routers/org";
import { internal } from "@app/lib/api";
import { AxiosResponse } from "axios";
import { authCookieHeader } from "@app/lib/api/cookies";
export const metadata: Metadata = {
title: `Setup - Pangolin`,
@@ -33,10 +37,28 @@ export default async function SetupLayout({
redirect("/");
}
let orgs: ListUserOrgsResponse["orgs"] = [];
try {
const getOrgs = cache(async () =>
internal.get<AxiosResponse<ListUserOrgsResponse>>(
`/user/${user.userId}/orgs`,
await authCookieHeader()
)
);
const res = await getOrgs();
if (res && res.data.data.orgs) {
orgs = res.data.data.orgs;
}
} catch (e) {}
return (
<>
<UserProvider user={user}>
<Layout navItems={rootNavItems} showBreadcrumbs={false}>
<Layout
navItems={rootNavItems}
showBreadcrumbs={false}
orgs={orgs}
>
<div className="w-full max-w-2xl mx-auto md:mt-32 mt-4">
{children}
</div>