Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
GiftReminder
Back-end
Commits
299e0bd1
Commit
299e0bd1
authored
9 months ago
by
Dalton Belman Albeche
Browse files
Options
Download
Email Patches
Plain Diff
corrigido o retorno do metodo retorna listas no controller e seus trys
parent
c68bd65c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/controllers/user.py
+3
-3
app/controllers/user.py
app/routes/user.py
+1
-1
app/routes/user.py
with
4 additions
and
4 deletions
+4
-4
app/controllers/user.py
View file @
299e0bd1
...
...
@@ -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
This diff is collapsed.
Click to expand it.
app/routes/user.py
View file @
299e0bd1
...
...
@@ -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
""" Return
s a list of wishlists related to
an User
"""
return
await
user_controller
.
returnUserLists
(
user_id
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help