mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-09 08:33:39 +00:00
fix: project and app change (#1395)
* fix: project and app change * fix: project and app change
This commit is contained in:
parent
e163ea75cd
commit
2fa4f1f9b3
@ -168,7 +168,7 @@ func (p *Project) AppendEvent(event *es_models.Event) error {
|
||||
}
|
||||
|
||||
func (p *Project) AppendAddProjectEvent(event *es_models.Event) error {
|
||||
p.setData(event)
|
||||
p.SetData(event)
|
||||
p.State = int32(model.ProjectStateActive)
|
||||
return nil
|
||||
}
|
||||
@ -188,7 +188,7 @@ func (p *Project) appendRemovedEvent() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *Project) setData(event *es_models.Event) error {
|
||||
func (p *Project) SetData(event *es_models.Event) error {
|
||||
if err := json.Unmarshal(event.Data, p); err != nil {
|
||||
logging.Log("EVEN-lo9sr").WithError(err).Error("could not unmarshal event data")
|
||||
return err
|
||||
|
@ -179,7 +179,10 @@ func (a *ApplicationView) AppendEvent(event *models.Event) (err error) {
|
||||
case es_model.APIConfigChanged:
|
||||
return a.SetData(event)
|
||||
case es_model.ProjectChanged:
|
||||
return a.SetData(event)
|
||||
project := &es_model.Project{}
|
||||
project.SetData(event)
|
||||
a.ProjectRoleAssertion = project.ProjectRoleAssertion
|
||||
a.ProjectRoleCheck = project.ProjectRoleAssertion
|
||||
case es_model.ApplicationDeactivated:
|
||||
a.State = int32(model.AppStateInactive)
|
||||
case es_model.ApplicationReactivated:
|
||||
|
Loading…
x
Reference in New Issue
Block a user