add new routes: /api/tag/rows

This commit is contained in:
2023-09-04 16:01:58 +08:00
parent 75c2bf1c95
commit 7e78caab3a
3 changed files with 38 additions and 20 deletions

6
db.ts
View File

@@ -1021,6 +1021,12 @@ export class EhDb {
);
return s.length ? s[0] : undefined;
}
get_tag_rows() {
return this.db.queryEntries<Tag>(
"SELECT * FROM tag WHERE tag LIKE ?;",
["rows:%"],
);
}
async get_task(id: number) {
const s = await this.transaction(() =>
this.db.queryEntries<Task>("SELECT * FROM task WHERE id = ?;", [id])