MCPcopy
hub / github.com/nowork-studio/NotFair / updateCronPromptAction

Function updateCronPromptAction

notfair-cmo/src/server/actions/crons.ts:109–125  ·  view source on GitHub ↗
(
  id: string,
  message: string,
)

Source from the content-addressed store, hash-verified

107}
108
109export async function updateCronPromptAction(
110 id: string,
111 message: string,
112): Promise<{ ok: boolean; error?: string }> {
113 const trimmed = message.trim();
114 if (!trimmed) return { ok: false, error: "Prompt cannot be empty." };
115 try {
116 getDb()
117 .prepare("UPDATE scheduled_jobs SET message = ?, updated_at = ? WHERE id = ?")
118 .run(trimmed, new Date().toISOString(), id);
119 invalidateCronCache();
120 revalidatePath("/", "layout");
121 return { ok: true };
122 } catch (err) {
123 return { ok: false, error: err instanceof Error ? err.message : String(err) };
124 }
125}

Callers 2

savePromptFunction · 0.90

Calls 2

getDbFunction · 0.90
invalidateCronCacheFunction · 0.90

Tested by

no test coverage detected