From 1c438b27e229a8e5e68162b990d7ad768e6f0b07 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sat, 19 Sep 2026 14:15:08 -0400 Subject: [PATCH] fix(lessons): deleteLesson matches apiDelete's contract (#3734) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI 7059's typecheck, two errors on one line: `apiDelete` returns `Promise` and takes no type argument. I had given it the response body's shape, which it discards. Matched to how snippets delete, rather than adding a second delete helper to carry the batch id — no caller has wanted it, and the second helper would be the duplication rather than the feature. Everything else in the UI batch typechecked clean. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01821k5B3Ysecp9fNYs92Kuy --- frontend/src/api/lessons.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/api/lessons.ts b/frontend/src/api/lessons.ts index a8eddad..684200d 100644 --- a/frontend/src/api/lessons.ts +++ b/frontend/src/api/lessons.ts @@ -124,12 +124,12 @@ export function updateLesson( return apiPatch(`/api/lessons/${id}`, payload); } -export function deleteLesson( - id: number, -): Promise<{ deleted: number; deleted_batch_id: string }> { - return apiDelete<{ deleted: number; deleted_batch_id: string }>( - `/api/lessons/${id}`, - ); +/** Trash, not erase — recoverable. `apiDelete` discards the body, which is the + * established shape here (snippets delete the same way): the batch id is in + * the response, but no caller has needed it and inventing a second delete + * helper to carry it would be the duplication, not the feature. */ +export function deleteLesson(id: number): Promise { + return apiDelete(`/api/lessons/${id}`); } /** The lessons drawn FROM one record — the reverse of `learned_from`.