fix: session handlers (#586)

* fix: session handler when no sessions exists

* fix: error handling

* error handling

* fix: error handling

* fix: error handling

* fix: error handling

* some errors

Co-authored-by: Fabiennne <fabienne.gerschwiler@gmail.com>
This commit is contained in:
Livio Amstutz
2020-08-13 09:43:47 +02:00
committed by GitHub
parent 5c4fef296f
commit f61b30420a
14 changed files with 63 additions and 47 deletions

View File

@@ -36,13 +36,13 @@ func (p *Application) Reduce(event *models.Event) (err error) {
app := new(view_model.ApplicationView)
switch event.Type {
case es_model.ApplicationAdded:
app.AppendEvent(event)
err = app.AppendEvent(event)
case es_model.ApplicationChanged,
es_model.OIDCConfigAdded,
es_model.OIDCConfigChanged,
es_model.ApplicationDeactivated,
es_model.ApplicationReactivated:
err := app.SetData(event)
err = app.SetData(event)
if err != nil {
return err
}
@@ -50,9 +50,9 @@ func (p *Application) Reduce(event *models.Event) (err error) {
if err != nil {
return err
}
app.AppendEvent(event)
err = app.AppendEvent(event)
case es_model.ApplicationRemoved:
err := app.SetData(event)
err = app.SetData(event)
if err != nil {
return err
}