Function
updatePrompt
(id: string, updater: (prompt: Prompt) => void)
Source from the content-addressed store, hash-verified
| 108 | }, |
| 109 | |
| 110 | updatePrompt(id: string, updater: (prompt: Prompt) => void) { |
| 111 | const prompt = get().prompts[id] ?? { |
| 112 | title: "", |
| 113 | content: "", |
| 114 | id, |
| 115 | }; |
| 116 | |
| 117 | SearchService.remove(id); |
| 118 | updater(prompt); |
| 119 | const prompts = get().prompts; |
| 120 | prompts[id] = prompt; |
| 121 | set(() => ({ prompts })); |
| 122 | SearchService.add(prompt); |
| 123 | }, |
| 124 | |
| 125 | search(text: string) { |
| 126 | if (text.length === 0) { |
Callers
nothing calls this directly
Tested by
no test coverage detected