mirror of
https://github.com/docmost/docmost
synced 2025-03-28 21:13:28 +00:00
52 lines
1.4 KiB
TypeScript
52 lines
1.4 KiB
TypeScript
![]() |
import { queryClient } from "@/main.tsx";
|
||
|
import {
|
||
|
getBilling,
|
||
|
getBillingPlans,
|
||
|
} from "@/ee/billing/services/billing-service.ts";
|
||
|
import { getSpaces } from "@/features/space/services/space-service.ts";
|
||
|
import { getGroups } from "@/features/group/services/group-service.ts";
|
||
|
import { QueryParams } from "@/lib/types.ts";
|
||
|
import { getWorkspaceMembers } from "@/features/workspace/services/workspace-service.ts";
|
||
|
import { getLicenseInfo } from "@/ee/licence/services/license-service.ts";
|
||
|
|
||
|
export const prefetchWorkspaceMembers = () => {
|
||
|
const params = { limit: 100, page: 1, query: "" } as QueryParams;
|
||
|
queryClient.prefetchQuery({
|
||
|
queryKey: ["workspaceMembers", params],
|
||
|
queryFn: () => getWorkspaceMembers(params),
|
||
|
});
|
||
|
};
|
||
|
|
||
|
export const prefetchSpaces = () => {
|
||
|
queryClient.prefetchQuery({
|
||
|
queryKey: ["spaces", { page: 1 }],
|
||
|
queryFn: () => getSpaces({ page: 1 }),
|
||
|
});
|
||
|
};
|
||
|
|
||
|
export const prefetchGroups = () => {
|
||
|
queryClient.prefetchQuery({
|
||
|
queryKey: ["groups", { page: 1 }],
|
||
|
queryFn: () => getGroups({ page: 1 }),
|
||
|
});
|
||
|
};
|
||
|
|
||
|
export const prefetchBilling = () => {
|
||
|
queryClient.prefetchQuery({
|
||
|
queryKey: ["billing"],
|
||
|
queryFn: () => getBilling(),
|
||
|
});
|
||
|
|
||
|
queryClient.prefetchQuery({
|
||
|
queryKey: ["billing-plans"],
|
||
|
queryFn: () => getBillingPlans(),
|
||
|
});
|
||
|
};
|
||
|
|
||
|
export const prefetchLicense = () => {
|
||
|
queryClient.prefetchQuery({
|
||
|
queryKey: ["license"],
|
||
|
queryFn: () => getLicenseInfo(),
|
||
|
});
|
||
|
};
|