Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do Not Update An Existing Project With A New Group (AST-70718) #933

Merged
merged 8 commits into from
Nov 13, 2024
Merged
17 changes: 0 additions & 17 deletions internal/services/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,26 +245,9 @@ func updateProject(
}
}

if projectGroups != "" {
err = UpsertProjectGroupsByUpdateFlow(groupsWrapper, &projModel, projectsWrapper, accessManagementWrapper, projModelResp, projectGroups, projectID, projectName, featureFlagsWrapper)
if err != nil {
return projectID, err
}
}
return projectID, nil
}

func UpsertProjectGroupsByUpdateFlow(groupsWrapper wrappers.GroupsWrapper, projModel *wrappers.Project, projectsWrapper wrappers.ProjectsWrapper,
OrShamirCM marked this conversation as resolved.
Show resolved Hide resolved
accessManagementWrapper wrappers.AccessManagementWrapper, projModelResp *wrappers.ProjectResponseModel,
projectGroups string, projectID string, projectName string, featureFlagsWrapper wrappers.FeatureFlagsWrapper) error {
groupsMap, groups, groupErr := GetGroupMap(groupsWrapper, projectGroups, projModelResp, featureFlagsWrapper)
if groupErr != nil {
return groupErr
}
projModel.Groups = groups
return UpsertProjectGroups(projModel, projectsWrapper, accessManagementWrapper, projectID, projectName, featureFlagsWrapper, groupsMap)
OrShamirCM marked this conversation as resolved.
Show resolved Hide resolved
}

func UpsertProjectGroups(projModel *wrappers.Project, projectsWrapper wrappers.ProjectsWrapper,
accessManagementWrapper wrappers.AccessManagementWrapper, projectID string, projectName string,
featureFlagsWrapper wrappers.FeatureFlagsWrapper, groupsMap []*wrappers.Group) error {
Expand Down
Loading