fix: 修改目标分组名称后自动同步更新本地绑定表中的名称缓存,并为前端更新分组 URL 中的 groupId 进行 Url 编码

This commit is contained in:
liumangmang
2026-07-01 17:55:53 +08:00
parent 8c2f1c13bb
commit 3172ab18bf
4 changed files with 28 additions and 4 deletions
+10 -1
View File
@@ -331,7 +331,16 @@ def update_website_group(
"name": body.name,
"description": body.description,
}
return c.update_group(row.group_update_endpoint, group_id, payload)
resp = c.update_group(row.group_update_endpoint, group_id, payload)
# Sync updated group name to local group bindings cache
db.query(WebsiteGroupBinding).filter(
WebsiteGroupBinding.website_id == wid,
WebsiteGroupBinding.target_group_id == group_id
).update({"target_group_name": body.name})
db.commit()
return resp
except Exception as exc:
raise HTTPException(502, str(exc))