mirror of
https://github.com/Radiquum/AniX.git
synced 2025-05-03 11:29:40 +05:00
split to modules. ADD index page.
This commit is contained in:
parent
025ef2be93
commit
c82b6e7265
11 changed files with 120 additions and 53 deletions
21
backend/modules/user/profile.py
Normal file
21
backend/modules/user/profile.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
from fastapi import APIRouter
|
||||
from fastapi import Request
|
||||
from modules.proxy import apiRequest
|
||||
from modules.proxy import ENDPOINTS
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get("/{user_id}", summary="Get user profile by user ID")
|
||||
async def getUserById(request: Request, user_id: str, short: bool = False):
|
||||
res = await apiRequest(request, ENDPOINTS["profile"], user_id)
|
||||
if short is False:
|
||||
return res
|
||||
return {
|
||||
"code": res["code"],
|
||||
"profile": {
|
||||
"id": res["profile"]["id"],
|
||||
"login": res["profile"]["login"],
|
||||
"avatar": res["profile"]["avatar"],
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue