Implement assessment delete service method and endpoint
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user