[fix]规则链添加或修改存在多条主链

This commit is contained in:
PandaX
2023-11-21 10:27:07 +08:00
parent 8c4252f1a1
commit 0635e37d73
2 changed files with 28 additions and 5 deletions

View File

@@ -114,7 +114,8 @@ func (p *RuleChainApi) UpdateRuleRoot(rc *restfulx.ReqCtx) {
var rule entity.RuleChain
restfulx.BindJsonAndValid(rc, &rule)
// 修改主链为普通链
p.RuleChainApp.UpdateByRoot()
err := p.RuleChainApp.UpdateByRoot()
biz.ErrIsNil(err, "修改主链错误")
// 修改当前链为主链
p.RuleChainApp.Update(rule)
}