mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-30 15:04:18 +00:00
Stefano Pigozzi
e90221d1b6
forse ho implementato la scopa https://www.youtube.com/watch?v=NFclBewnVmY
14 lines
518 B
Python
14 lines
518 B
Python
from starlette.requests import Request
|
|
from starlette.responses import *
|
|
from royalnet.constellation import *
|
|
from royalnet.utils import *
|
|
from royalnet.backpack.tables import *
|
|
|
|
|
|
class ApiUserListStar(PageStar):
|
|
path = "/api/user/list"
|
|
|
|
async def page(self, request: Request) -> JSONResponse:
|
|
async with self.alchemy.session_acm() as session:
|
|
users: typing.List[User] = await asyncify(session.query(self.alchemy.get(User)).all)
|
|
return JSONResponse([user.json() for user in users])
|