mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-01 22:59:28 +00:00
Implemented Test.delete
This commit is contained in:
15
lib/Test.js
15
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) {
|
async hasAccess(u) {
|
||||||
const userTests = await u.getTests();
|
const userTests = await u.getTests();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user