mirror of
https://github.com/docmost/docmost.git
synced 2026-05-07 14:43:06 +08:00
69d7532c6c
feat: clickhouse driver * sync * updates
92 lines
2.4 KiB
TypeScript
92 lines
2.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";
|
|
import { getSsoProviders } from "@/ee/security/services/security-service.ts";
|
|
import { getShares } from "@/features/share/services/share-service.ts";
|
|
import { getApiKeys } from "@/ee/api-key";
|
|
import { getAuditLogs } from "@/ee/audit/services/audit-service";
|
|
|
|
export const prefetchWorkspaceMembers = () => {
|
|
const params: QueryParams = { limit: 100, query: "" };
|
|
queryClient.prefetchQuery({
|
|
queryKey: ["workspaceMembers", params],
|
|
queryFn: () => getWorkspaceMembers(params),
|
|
});
|
|
};
|
|
|
|
export const prefetchSpaces = () => {
|
|
queryClient.prefetchQuery({
|
|
queryKey: ["spaces", {}],
|
|
queryFn: () => getSpaces({}),
|
|
});
|
|
};
|
|
|
|
export const prefetchGroups = () => {
|
|
queryClient.prefetchQuery({
|
|
queryKey: ["groups", {}],
|
|
queryFn: () => getGroups({}),
|
|
});
|
|
};
|
|
|
|
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(),
|
|
});
|
|
};
|
|
|
|
export const prefetchShares = () => {
|
|
queryClient.prefetchQuery({
|
|
queryKey: ["share-list", {}],
|
|
queryFn: () => getShares({}),
|
|
});
|
|
};
|
|
|
|
export const prefetchApiKeys = () => {
|
|
queryClient.prefetchQuery({
|
|
queryKey: ["api-key-list", {}],
|
|
queryFn: () => getApiKeys({}),
|
|
});
|
|
};
|
|
|
|
export const prefetchApiKeyManagement = () => {
|
|
queryClient.prefetchQuery({
|
|
queryKey: ["api-key-list", { adminView: true }],
|
|
queryFn: () => getApiKeys({ adminView: true }),
|
|
});
|
|
};
|
|
|
|
export const prefetchAuditLogs = () => {
|
|
const params = { limit: 50 };
|
|
queryClient.prefetchQuery({
|
|
queryKey: ["audit-logs", params],
|
|
queryFn: () => getAuditLogs(params),
|
|
});
|
|
};
|