mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-06 13:27:45 +00:00
fix: delete org domain (#234)
This commit is contained in:
parent
b5376b2e5a
commit
5e39a5f813
@ -84,7 +84,7 @@ func (d *OrgDomain) processOrgDomain(event *models.Event) (err error) {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return d.view.DeleteOrgDomain(domain.Domain, event.Sequence)
|
||||
return d.view.DeleteOrgDomain(event.AggregateID, domain.Domain, event.Sequence)
|
||||
default:
|
||||
return d.view.ProcessedOrgDomainSequence(event.Sequence)
|
||||
}
|
||||
|
@ -38,8 +38,8 @@ func (v *View) PutOrgDomain(org *model.OrgDomainView, sequence uint64) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v *View) DeleteOrgDomain(domain string, eventSequence uint64) error {
|
||||
err := view.DeleteOrgDomain(v.Db, orgDomainTable, domain)
|
||||
func (v *View) DeleteOrgDomain(orgID, domain string, eventSequence uint64) error {
|
||||
err := view.DeleteOrgDomain(v.Db, orgDomainTable, orgID, domain)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
@ -58,7 +58,10 @@ func PutOrgDomain(db *gorm.DB, table string, role *model.OrgDomainView) error {
|
||||
return save(db, role)
|
||||
}
|
||||
|
||||
func DeleteOrgDomain(db *gorm.DB, table, domain string) error {
|
||||
delete := view.PrepareDeleteByKey(table, model.OrgSearchKey(org_model.ORGDOMAINSEARCHKEY_DOMAIN), domain)
|
||||
func DeleteOrgDomain(db *gorm.DB, table, orgID, domain string) error {
|
||||
delete := view.PrepareDeleteByKeys(table,
|
||||
view.Key{Key: model.OrgDomainSearchKey(org_model.ORGDOMAINSEARCHKEY_DOMAIN), Value: domain},
|
||||
view.Key{Key: model.OrgDomainSearchKey(org_model.ORGDOMAINSEARCHKEY_ORG_ID), Value: orgID},
|
||||
)
|
||||
return delete(db)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user