added being able to assign sessions to projects via the sessions modal

This commit is contained in:
Storme-bit
2026-04-13 20:36:42 -07:00
parent e3f6b9a9db
commit 649ed2b350
8 changed files with 163 additions and 121 deletions

View File

@@ -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);
}