Files
pangolin/src/lib/api/getCachedOrgUser.ts
Fred KISSIE f58cf68f7c 🚧 WIP
2025-11-11 23:35:20 +01:00

14 lines
489 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 ".";
import type { GetOrgUserResponse } from "@server/routers/user";
export const getCachedOrgUser = cache(async (orgId: string, userId: string) =>
internal.get<AxiosResponse<GetOrgUserResponse>>(
`/org/${orgId}/user/${userId}`,
await authCookieHeader()
)
);