diff --git a/surfsense_web/lib/query-client/cache-keys.ts b/surfsense_web/lib/query-client/cache-keys.ts index fcdf322bc..e488d2c0e 100644 --- a/surfsense_web/lib/query-client/cache-keys.ts +++ b/surfsense_web/lib/query-client/cache-keys.ts @@ -2,6 +2,7 @@ import type { GetChatsRequest } from "@/contracts/types/chat.types"; import type { GetDocumentsRequest } from "@/contracts/types/document.types"; import type { GetLLMConfigsRequest } from "@/contracts/types/llm-config.types"; import type { GetPodcastsRequest } from "@/contracts/types/podcast.types"; +import type { GetSearchSpacesRequest } from "@/contracts/types/search-space.types"; export const cacheKeys = { chats: { @@ -33,4 +34,17 @@ export const cacheKeys = { auth: { user: ["auth", "user"] as const, }, + searchSpaces: { + all: ["search-spaces"] as const, + withQueryParams: (queries: GetSearchSpacesRequest["queryParams"]) => + ["search-spaces", ...(queries ? Object.values(queries) : [])] as const, + detail: (searchSpaceId: string) => ["search-spaces", searchSpaceId] as const, + communityPrompts: ["search-spaces", "community-prompts"] as const, + }, + llmConfigs: { + all: (searchSpaceId: string) => ["llm-configs", searchSpaceId] as const, + global: ["llm-configs", "global"] as const, + detail: (searchSpaceId: string, llmConfigId: string) => ["llm-configs", searchSpaceId, llmConfigId] as const, + preferences: (searchSpaceId: string) => ["llm-configs", "preferences", searchSpaceId] as const, + }, };