1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-24 03:54:20 +00:00
royalnet/royalpack/stars/api_user_list.py

14 lines
478 B
Python

from starlette.requests import Request
from starlette.responses import *
from royalnet.constellation import *
from royalnet.utils import *
from royalnet.backpack.tables import *
from royalnet.constellation.api import *
class ApiUserListStar(ApiStar):
path = "/api/user/list/v1"
async def api(self, data: ApiData) -> dict:
users: typing.List[User] = await asyncify(data.session.query(self.alchemy.get(User)).all)
return [user.json() for user in users]