diff --git a/unwind/web.py b/unwind/web.py index d5c336a..51543d0 100644 --- a/unwind/web.py +++ b/unwind/web.py @@ -234,6 +234,13 @@ async def load_imdb_user_ratings(request): 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"]) @requires(["authenticated", "admin"]) async def add_group(request):