Commit 299e0bd1 authored by Dalton Belman Albeche's avatar Dalton Belman Albeche
Browse files

corrigido o retorno do metodo retorna listas no controller e seus trys

parent c68bd65c
Showing with 4 additions and 4 deletions
+4 -4
......@@ -168,12 +168,12 @@ async def decline_friend_request(friendship_id: UUID4) -> bool:
async def returnUserLists(user: UUID4) -> list:
""" Return a list of all the users list grouped by events id
"""
try
try:
user = await User.get(user_id=user_id)
except Exception as e:
raise HTTPException(status_code=404, detail="User not found")
try
try:
wishlist_items = await UserWishlistItem.filter(user_id=user.user_id).prefetch_related('item_id', 'event_id')
except Exception as e:
raise HTTPException(status_code=404, detail="User items not found or does not exist")
......@@ -188,4 +188,4 @@ async def returnUserLists(user: UUID4) -> list:
grouped_items = list(items.values())
return items
\ No newline at end of file
return grouped_items
\ No newline at end of file
......@@ -82,7 +82,7 @@ async def check_valid_password(password: str):
@router.get("/returnUserLists/{user_id}", response_model = list)
async def returnUserLists(user_id: UUID4):
""" Return each event wishlist of an User
""" Returns a list of wishlists related to an User
"""
return await user_controller.returnUserLists(user_id)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment