mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-12 22:42:13 +02:00
Unify frontend prompt rendering to use API-only prompt library
Remove hardcoded DEFAULT_ACTIONS and icon map from prompt-picker, fetch all prompts from the backend. Simplify Zod types to match the single-table schema (drop source/system_prompt_slug/is_modified, add version). Update PromptsContent empty state copy.
This commit is contained in:
parent
11387268a7
commit
95620a4331
3 changed files with 44 additions and 172 deletions
|
|
@ -3,16 +3,14 @@ import { z } from "zod";
|
|||
export type PromptMode = "transform" | "explore";
|
||||
|
||||
export const promptRead = z.object({
|
||||
id: z.number().nullable(),
|
||||
id: z.number(),
|
||||
name: z.string(),
|
||||
prompt: z.string(),
|
||||
mode: z.enum(["transform", "explore"]),
|
||||
search_space_id: z.number().nullable().optional(),
|
||||
is_public: z.boolean().optional(),
|
||||
created_at: z.string().nullable().optional(),
|
||||
source: z.enum(["system", "custom"]),
|
||||
system_prompt_slug: z.string().nullable().optional(),
|
||||
is_modified: z.boolean().optional(),
|
||||
search_space_id: z.number().nullable(),
|
||||
is_public: z.boolean(),
|
||||
version: z.number(),
|
||||
created_at: z.string(),
|
||||
});
|
||||
|
||||
export type PromptRead = z.infer<typeof promptRead>;
|
||||
|
|
@ -46,14 +44,6 @@ export const promptUpdateRequest = z.object({
|
|||
|
||||
export type PromptUpdateRequest = z.infer<typeof promptUpdateRequest>;
|
||||
|
||||
export const systemPromptUpdateRequest = z.object({
|
||||
name: z.string().min(1).max(200).optional(),
|
||||
prompt: z.string().min(1).optional(),
|
||||
mode: z.enum(["transform", "explore"]).optional(),
|
||||
});
|
||||
|
||||
export type SystemPromptUpdateRequest = z.infer<typeof systemPromptUpdateRequest>;
|
||||
|
||||
export const promptDeleteResponse = z.object({
|
||||
success: z.boolean(),
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue