Lessons step 7 — a lesson is readable, writable and browsable by a human (#3734) #169
@@ -124,12 +124,12 @@ export function updateLesson(
|
||||
return apiPatch<Lesson>(`/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<void> {
|
||||
return apiDelete(`/api/lessons/${id}`);
|
||||
}
|
||||
|
||||
/** The lessons drawn FROM one record — the reverse of `learned_from`.
|
||||
|
||||
Reference in New Issue
Block a user