mirror of
https://github.com/docmost/docmost.git
synced 2026-05-07 14:43:06 +08:00
5c9e0a2630
* hide sso enforcement in standard plan
59 lines
1.6 KiB
TypeScript
59 lines
1.6 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";
|
|
import { getSsoProviders } from '@/ee/security/services/security-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(),
|
|
});
|
|
};
|
|
|
|
export const prefetchSsoProviders = () => {
|
|
queryClient.prefetchQuery({
|
|
queryKey: ["sso-providers"],
|
|
queryFn: () => getSsoProviders(),
|
|
});
|
|
}; |