Implement create custom recommendations

This commit is contained in:
adilallo
2026-04-20 12:41:10 -06:00
parent e9dab04b34
commit 45bbbb8a35
75 changed files with 6403 additions and 1452 deletions
+17
View File
@@ -118,6 +118,23 @@ async function errorBodyMessage(res: Response): Promise<string> {
return "Save failed";
}
/**
* Wipe the signed-in user's saved draft. Fire-and-forget: any non-2xx (including
* the sync-flag-off `503` and the unauthenticated `401`) is swallowed because
* callers only invoke this on already-published / explicitly-discarded flows
* where a leftover server draft is acceptable.
*/
export async function deleteServerDraft(): Promise<void> {
try {
await fetch("/api/drafts/me", {
method: "DELETE",
credentials: "include",
});
} catch {
/* ignore — server draft cleanup is best-effort */
}
}
export async function saveDraftToServer(
state: CreateFlowState,
): Promise<SaveDraftResult> {