From ef135682210795164286c6380abca912717aebb0 Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 21 Apr 2022 13:08:41 +0000 Subject: [PATCH] Implemented Test.delete --- lib/Test.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/Test.js b/lib/Test.js index 85ff2c6..d516c31 100644 --- a/lib/Test.js +++ b/lib/Test.js @@ -147,6 +147,21 @@ class Test { ); } + async delete() { + const sql = ` + delete from + test + where + testId = ?; + `; + + try { + await this.#conn.runQuery(sql, [ this.id ]); + } catch (e) { + console.error(e); + } + } + async hasAccess(u) { const userTests = await u.getTests();