Files
pangolin/src/lib/api/getCachedOrg.ts
2025-10-28 00:14:27 +01:00

13 lines
386 B
TypeScript

import type { GetOrgResponse } from "@server/routers/org";
import type { AxiosResponse } from "axios";
import { cache } from "react";
import { authCookieHeader } from "./cookies";
import { internal } from ".";
export const getCachedOrg = cache(async (orgId: string) =>
internal.get<AxiosResponse<GetOrgResponse>>(
`/org/${orgId}`,
await authCookieHeader()
)
);