mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
15 lines
444 B
Python
15 lines
444 B
Python
|
from royalnet.utils import *
|
||
|
from royalnet.backpack.tables import *
|
||
|
from royalnet.constellation.api import *
|
||
|
from ..utils import find_user_api
|
||
|
|
||
|
|
||
|
class ApiBioGetStar(ApiStar):
|
||
|
path = "/api/bio/get/v1"
|
||
|
|
||
|
async def api(self, data: ApiData) -> dict:
|
||
|
user = await find_user_api(data["id"], self.alchemy, data.session)
|
||
|
if user.bio is None:
|
||
|
raise NotFoundError("User has no bio set.")
|
||
|
return user.bio.json()
|