fix: handle domain remove correctly (#2978)

This commit is contained in:
Livio Amstutz 2022-01-11 12:00:42 +01:00 committed by GitHub
parent d03cab22c0
commit 2355fcb7cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,6 +78,10 @@ func (wm *OrgDomainWriteModel) Reduce() error {
wm.Primary = e.Domain == wm.Domain
case *org.DomainRemovedEvent:
wm.State = domain.OrgDomainStateRemoved
wm.Verified = false
wm.Primary = false
wm.ValidationType = domain.OrgDomainValidationTypeUnspecified
wm.ValidationCode = nil
}
}
return nil