Changed the List function to use project name instead of project id

This commit is contained in:
Dan
2024-05-04 19:35:01 -04:00
parent e8ce8575e8
commit 80becf1961
2 changed files with 13 additions and 2 deletions

View File

@@ -36,6 +36,12 @@ async def get_project_id(name):
result = await cursor.fetchone()
return result[0] if result else None
async def get_project_name(project_id):
async with aiosqlite.connect(DATABASE) as db:
cursor = await db.execute("SELECT name FROM projects WHERE id = ?", (project_id,))
result = await cursor.fetchone()
return result[0] if result else None
async def add_task_to_project(project_id, description, assignee, deadline, status, priority):
async with aiosqlite.connect(DATABASE) as db:
# Change the date format to MM/DD/YYYY