Implement assessment delete service method and endpoint

This commit is contained in:
Dominic Ferrando
2026-08-22 12:00:36 -04:00
parent 01e9ac8403
commit 951f9286aa
2 changed files with 16 additions and 4 deletions
+8
View File
@@ -39,4 +39,12 @@ export class AssessmentsService {
.$if(opt.offset !== undefined, (qb) => qb.offset(opt.offset!))
.execute();
}
async delete(id: string, accountId: string): Promise<boolean> {
const result = await db.deleteFrom("assessments")
.where("id", "=", id)
.where("account_id", "=", accountId)
.executeTakeFirst();
return result.numDeletedRows > 0n;
}
}