🪻 distributed transcription service thistle.dunkirk.sh
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: validate class exists before archiving

Check if class exists when toggling archive status and throw error
if not found. Prevents silent failures when archiving non-existent
classes.

Fixes issue #28 (partial)

+5 -1
+5 -1
src/lib/classes.ts
··· 135 135 * Archive or unarchive a class 136 136 */ 137 137 export function toggleClassArchive(classId: string, archived: boolean): void { 138 - db.run("UPDATE classes SET archived = ? WHERE id = ?", [ 138 + const result = db.run("UPDATE classes SET archived = ? WHERE id = ?", [ 139 139 archived ? 1 : 0, 140 140 classId, 141 141 ]); 142 + 143 + if (result.changes === 0) { 144 + throw new Error("Class not found"); 145 + } 142 146 } 143 147 144 148 /**