feat(search-spaces): add cache keys for search spaces and llm configs

This commit is contained in:
CREDO23 2025-12-11 20:35:01 +00:00
parent 172f58f742
commit edfe2aa87e

View file

@ -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,
},
};