Commit 2a4a2a28 authored by Mikhail Sennikov's avatar Mikhail Sennikov
Browse files

Fix Depends

parent 854b9ca5
No related merge requests found
Showing with 10 additions and 8 deletions
+10 -8
from fastapi import APIRouter, Response, HTTPException, status
from fastapi import APIRouter, Response, HTTPException, status, Depends
from node.swarm import NodeSwarm
from database.schemas.cam_groups import GroupFull
......@@ -8,18 +8,20 @@ swarm = NodeSwarm()
@switch_router.post("/set_group_id/{group_id}", response_model=GroupFull)
async def set_group(
group_id: int
async def set_group_id(
group_id: int,
set_group_by_id=Depends(swarm.set_group_by_id)
):
group = await swarm.set_group_by_id(group_id)
group = await set_group_by_id(group_id)
return group
@switch_router.post("/set_group_slug/{group_slug}", response_model=GroupFull)
async def set_group(
group_slug: str
async def set_group_slug(
group_slug: str,
set_group_by_slug=Depends(swarm.set_group_by_slug)
):
group = await swarm.set_group_by_slug(group_slug)
group = await set_group_by_slug(group_slug)
return group
......
......@@ -107,7 +107,7 @@ async def list_user_groups(
@db_cam_groups_router.post("/user/{user_id}", response_model=GroupFull, tags=["Users"])
async def add_cam_group(
async def add_user_group(
user_id: int,
group_id: int,
user_repo: UserRepository = Depends(db.get_repository(UserRepository)),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment