added being able to assign sessions to projects via the sessions modal
This commit is contained in:
@@ -52,13 +52,15 @@ function deleteSession(id) {
|
||||
db.prepare(`DELETE FROM sessions WHERE id = ?`).run(id);
|
||||
}
|
||||
|
||||
function updateSession(id, { name } = {}){
|
||||
function updateSession(id, { name, projectId } = {}) {
|
||||
const db = getDB();
|
||||
db.prepare(`
|
||||
UPDATE sessions
|
||||
SET name = ?, updated_at = unixepoch()
|
||||
SET name = ?,
|
||||
project_id = COALESCE(?, project_id),
|
||||
updated_at = unixepoch()
|
||||
WHERE id = ?
|
||||
`).run(name ?? null, id);
|
||||
`).run(name ?? null, projectId ?? null, id);
|
||||
return getSession(id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user