mirror of
https://github.com/rjNemo/graphql_python_template
synced 2026-06-06 02:26:47 +00:00
11 lines
265 B
Python
11 lines
265 B
Python
from app.models.todo import Todo
|
|
from app.repositories.todos import get_todo_by_id, todo_exists
|
|
|
|
|
|
def close_todo(todo_id: str) -> Todo:
|
|
if not todo_exists(todo_id):
|
|
return None
|
|
|
|
todo = get_todo_by_id(todo_id)
|
|
todo.is_done = True
|
|
return todo
|