Skip to content

Commit

Permalink
fix collaboration mode name duplicate problem
Browse files Browse the repository at this point in the history
Signed-off-by: Min Min <[email protected]>
  • Loading branch information
jamsman94 committed Dec 3, 2024
1 parent 92e5bd8 commit 3ee80a1
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,9 @@ func getDiff(cmMap map[string]*models.CollaborationMode, ciMap map[string]*model
var deleteItems []models.CollaborationInstance
for name, cm := range cmMap {
if ci, ok := ciMap[name]; ok {
if cm.Revision < ci.Revision {
return nil, fmt.Errorf("CollaborationMode:%s revision error", name)
} else if cm.Revision > ci.Revision {
updateItems = append(updateItems, getUpdateDiff(cm, ci))
instance := genCollaborationInstance(*cm, projectName, uid, identityType, userName)
updateInstance = append(updateInstance, *instance)
}
updateItems = append(updateItems, getUpdateDiff(cm, ci))
instance := genCollaborationInstance(*cm, projectName, uid, identityType, userName)
updateInstance = append(updateInstance, *instance)
} else {
newItems = append(newItems, *cm)
}
Expand Down

0 comments on commit 3ee80a1

Please sign in to comment.