add route for admins to list all groups
This commit is contained in:
parent
88fa1355cd
commit
cc0ba96a9e
1 changed files with 7 additions and 0 deletions
|
|
@ -234,6 +234,13 @@ async def load_imdb_user_ratings(request):
|
||||||
return JSONResponse({"new_ratings": [asplain(r) for r in ratings]})
|
return JSONResponse({"new_ratings": [asplain(r) for r in ratings]})
|
||||||
|
|
||||||
|
|
||||||
|
@route("/groups")
|
||||||
|
@requires(["authenticated", "admin"])
|
||||||
|
async def list_groups(request):
|
||||||
|
groups = await db.get_all(Group)
|
||||||
|
return JSONResponse([asplain(g) for g in groups])
|
||||||
|
|
||||||
|
|
||||||
@route("/groups", methods=["POST"])
|
@route("/groups", methods=["POST"])
|
||||||
@requires(["authenticated", "admin"])
|
@requires(["authenticated", "admin"])
|
||||||
async def add_group(request):
|
async def add_group(request):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue