diff --git a/backend/app/routers/websites.py b/backend/app/routers/websites.py index 241ec94..a2bd3fb 100644 --- a/backend/app/routers/websites.py +++ b/backend/app/routers/websites.py @@ -314,7 +314,7 @@ def create_website_group( raise HTTPException(502, str(exc)) -@router.put("/api/websites/{wid}/groups/{group_id}", response_model=dict) +@router.put("/api/websites/{wid}/groups/{group_id:path}", response_model=dict) def update_website_group( wid: int, group_id: str, diff --git a/backend/test_website_group_mgmt.py b/backend/test_website_group_mgmt.py index 7a8c489..5ec1fa0 100644 --- a/backend/test_website_group_mgmt.py +++ b/backend/test_website_group_mgmt.py @@ -42,7 +42,7 @@ def test_create_and_update_website_group(db_session, monkeypatch): b = WebsiteGroupBinding( website_id=w.id, - target_group_id="g123", + target_group_id="g/123", target_group_name="OldName", source_groups_json="[]", enabled=True @@ -81,12 +81,12 @@ def test_create_and_update_website_group(db_session, monkeypatch): # 2. Test update_website_group body_update = WebsiteGroupUpdate(name="UpdatedGroup", description="UpdatedDesc") - res_update = update_website_group(wid=w.id, group_id="g123", body=body_update, db=db_session) - assert res_update["id"] == "g123" + res_update = update_website_group(wid=w.id, group_id="g/123", body=body_update, db=db_session) + assert res_update["id"] == "g/123" assert res_update["name"] == "UpdatedGroup" assert res_update["description"] == "UpdatedDesc" assert len(called_update) == 1 - assert called_update[0][1] == "g123" + assert called_update[0][1] == "g/123" assert called_update[0][2] == {"name": "UpdatedGroup", "description": "UpdatedDesc"} # Verify that local binding was updated