mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 02:54:20 +00:00
fix: project add validation (#997)
* fix: add project validation * fix: removed loop
This commit is contained in:
parent
5d2c053f87
commit
855725c3c0
@ -514,8 +514,8 @@ func addProjectValidation(projectName string) func(...*es_models.Event) error {
|
||||
_, project := model.GetProject(projects, event.AggregateID)
|
||||
project.AppendAddProjectEvent(event)
|
||||
case model.ProjectRemoved:
|
||||
for i, project := range projects {
|
||||
if project.AggregateID == event.AggregateID {
|
||||
for i := len(projects) - 1; i >= 0; i-- {
|
||||
if projects[i].AggregateID == event.AggregateID {
|
||||
projects[i] = projects[len(projects)-1]
|
||||
projects[len(projects)-1] = nil
|
||||
projects = projects[:len(projects)-1]
|
||||
|
Loading…
Reference in New Issue
Block a user