first commit
This commit is contained in:
21
app/api/v1/role.py
Normal file
21
app/api/v1/role.py
Normal file
@ -0,0 +1,21 @@
|
||||
from time import time
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
from app import mongo
|
||||
from app.utils.response_util import response
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get("/get-all", tags=[""])
|
||||
async def get_all():
|
||||
start_time = time()
|
||||
|
||||
roles = await mongo.roles_collection.find({}, {
|
||||
"_id": False
|
||||
}).sort("id", mongo.desc).to_list()
|
||||
|
||||
return response({
|
||||
"roles": roles
|
||||
}, start_time=start_time)
|
||||
Reference in New Issue
Block a user