mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-13 05:06:25 +00:00
🚧 WIP
This commit is contained in:
13
src/lib/api/getCachedOrgUser.ts
Normal file
13
src/lib/api/getCachedOrgUser.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
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()
|
||||
)
|
||||
);
|
||||
8
src/lib/api/getCachedSubscription.ts
Normal file
8
src/lib/api/getCachedSubscription.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import type { AxiosResponse } from "axios";
|
||||
import { cache } from "react";
|
||||
import { priv } from ".";
|
||||
import type { GetOrgTierResponse } from "@server/routers/billing/types";
|
||||
|
||||
export const getCachedSubscription = cache(async (orgId: string) =>
|
||||
priv.get<AxiosResponse<GetOrgTierResponse>>(`/org/${orgId}/billing/tier`)
|
||||
);
|
||||
@@ -60,4 +60,3 @@ export const priv = axios.create({
|
||||
});
|
||||
|
||||
export * from "./formatAxiosError";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user