mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-01 07:39:09 +00:00
14 lines
489 B
TypeScript
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()
|
|
)
|
|
);
|