get sessions by projectId
This commit is contained in:
@@ -31,7 +31,11 @@ function updateProject(id, { name, description, colour, icon }) {
|
||||
|
||||
function deleteProject(id) {
|
||||
const db = getDB();
|
||||
const doDelete = db.transaction(() => {
|
||||
db.prepare(`UPDATE sessions SET project_id = NULL WHERE project_id = ?`).run(id);
|
||||
db.prepare(`DELETE FROM projects WHERE id = ?`).run(id);
|
||||
});
|
||||
doDelete();
|
||||
}
|
||||
|
||||
module.exports = { createProject, getProjects, getProject, updateProject, deleteProject };
|
||||
Reference in New Issue
Block a user