Fix create_prompt is_public bug, conditional version bump, and add Jotai prompts atoms

- Pass is_public from request body in create_prompt route
- Only bump version on content field changes (name, prompt, mode),
  not on is_public toggle
- Add prompts query and mutation atoms (atomWithQuery/atomWithMutation)
  with TanStack Query caching, replacing manual useEffect fetches
- Update PromptPicker, PromptsContent, and CommunityPromptsContent
  to consume shared atoms instead of local state
This commit is contained in:
CREDO23 2026-03-31 18:34:10 +02:00
parent 95620a4331
commit 5f4f7780d1
7 changed files with 184 additions and 88 deletions

View file

@ -91,6 +91,10 @@ export const cacheKeys = {
bySearchSpace: (searchSpaceId: number) =>
["public-chat-snapshots", "search-space", searchSpaceId] as const,
},
prompts: {
all: () => ["prompts"] as const,
public: () => ["prompts", "public"] as const,
},
notifications: {
search: (searchSpaceId: number | null, search: string, tab: string) =>
["notifications", "search", searchSpaceId, search, tab] as const,