mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-01 20:59:30 +00:00
Implemented TestTemplate.getTests
This commit is contained in:
@@ -94,6 +94,26 @@ class TestTemplate {
|
||||
return new (require('./Account'))(this.#conn, this.accountId);
|
||||
}
|
||||
|
||||
async getTests() {
|
||||
const sql = `
|
||||
select
|
||||
testId as id
|
||||
from
|
||||
test
|
||||
where
|
||||
testTemplateId = ?;
|
||||
`;
|
||||
|
||||
return await Promise.all(
|
||||
(await this.#conn.runQuery(sql, [ this.id ]))
|
||||
.map(record => {
|
||||
return new (require('./Test'))(
|
||||
this.#conn,
|
||||
record.id);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
async assignClass(classId, date) {
|
||||
const c = await new Class(this.#conn, classId);
|
||||
const id = crypto.randomUUID();
|
||||
|
||||
Reference in New Issue
Block a user