memory contexte
This commit is contained in:
21
memory.py
21
memory.py
@@ -195,6 +195,27 @@ def add_task(title, client_name="", project_name="", details="", due_at=""):
|
||||
return row_to_dict(db.execute("SELECT * FROM tasks WHERE id = ?", (cursor.lastrowid,)).fetchone())
|
||||
|
||||
|
||||
def close_task(task_id):
|
||||
with connect() as db:
|
||||
row = db.execute(
|
||||
"""
|
||||
SELECT t.*, c.name AS client_name, p.name AS project_name
|
||||
FROM tasks t
|
||||
LEFT JOIN clients c ON c.id = t.client_id
|
||||
LEFT JOIN projects p ON p.id = t.project_id
|
||||
WHERE t.id = ? AND t.done = 0
|
||||
""",
|
||||
(task_id,),
|
||||
).fetchone()
|
||||
if not row:
|
||||
return None
|
||||
db.execute(
|
||||
"UPDATE tasks SET done = 1, updated_at = CURRENT_TIMESTAMP WHERE id = ?",
|
||||
(task_id,),
|
||||
)
|
||||
return row_to_dict(row)
|
||||
|
||||
|
||||
def add_repository(name, project_name="", local_path="", remote_url="", main_branch=""):
|
||||
name = clean_text(name) or derive_repo_name(local_path, remote_url)
|
||||
if not name:
|
||||
|
||||
Reference in New Issue
Block a user