Skip to content

Commit

Permalink
Return a TodosItemComplete
Browse files Browse the repository at this point in the history
  • Loading branch information
armanddidierjean committed Nov 6, 2023
1 parent 756a7d9 commit b214309
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/endpoints/todos.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async def get_todos(
# We define a new endpoint, accepting a POST, that intend to create a new todo
@router.post(
"/todos/",
response_model=schemas_todos.TodosItemBase,
response_model=schemas_todos.TodosItemComplete,
status_code=201,
tags=[Tags.todos],
)
Expand All @@ -59,11 +59,11 @@ async def create_todo(
# the operation is called unpacking
)
try:
res = await cruds_todos.create_item(
await cruds_todos.create_item(
item=db_item,
db=db,
)
return res
return db_item
except ValueError as error:
# If we failed to create the object in the database,
# we send back a 400 error code with the detail of the error
Expand Down

0 comments on commit b214309

Please sign in to comment.