diff --git a/api.py b/api.py index 568c3dc..cf1c646 100644 --- a/api.py +++ b/api.py @@ -48,6 +48,8 @@ async def update_user_task(task: UpdateTask, session: SessionDep, current_user: user_data = task.model_dump(exclude_unset=True) new_task = user_data + if user_db.tasks is None: + user_db.tasks = [] # Filter out the task with matching title and keep all others updated_tasks = [