mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 04:57:33 +00:00
fix: add migration (#361)
* fix: add migration * fix: add migration * fix: delete primary domain * Update en.yaml Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
@@ -179,9 +179,13 @@ func (es *OrgEventstore) RemoveOrgDomain(ctx context.Context, domain *org_model.
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !existing.ContainsDomain(domain) {
|
||||
_, d := existing.GetDomain(domain)
|
||||
if d == nil {
|
||||
return errors.ThrowPreconditionFailed(nil, "EVENT-Sjdi3", "Errors.Org.DomainNotOnOrg")
|
||||
}
|
||||
if d.Primary {
|
||||
return errors.ThrowPreconditionFailed(nil, "EVENT-Sjdi3", "Errors.Org.PrimaryDomainNotDeletable")
|
||||
}
|
||||
repoOrg := model.OrgFromModel(existing)
|
||||
repoDomain := model.OrgDomainFromModel(domain)
|
||||
orgAggregates, err := OrgDomainRemovedAggregate(ctx, es.Eventstore.AggregateCreator(), repoOrg, repoDomain)
|
||||
|
Reference in New Issue
Block a user