mirror of
https://github.com/MODSetter/SurfSense
synced 2026-06-21 13:44:09 +00:00
feat(search-spaces): add cache keys for search spaces and llm configs
This commit is contained in:
@@ -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,
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user