fix: app by id, views with computed objects (#583)

* feat: read app by id if my events

* fix: handlers if no sublist

* fix: removed app

* fix: removed project

* fix: removed app

* fix: removed app

* fix: app by id with projectid
This commit is contained in:
Fabi
2020-08-13 08:28:18 +02:00
committed by GitHub
parent 2f404be7c6
commit 5c4fef296f
18 changed files with 71 additions and 14 deletions

View File

@@ -46,7 +46,7 @@ func (p *Application) Reduce(event *models.Event) (err error) {
if err != nil {
return err
}
app, err = p.view.ApplicationByID(app.ID)
app, err = p.view.ApplicationByID(event.AggregateID, app.ID)
if err != nil {
return err
}

View File

@@ -115,6 +115,9 @@ func (u *UserGrant) processUser(event *models.Event) (err error) {
if err != nil {
return err
}
if len(grants) == 0 {
return u.view.ProcessedUserGrantSequence(event.Sequence)
}
user, err := u.userEvents.UserByID(context.Background(), event.AggregateID)
if err != nil {
return err

View File

@@ -14,8 +14,8 @@ const (
applicationTable = "auth.applications"
)
func (v *View) ApplicationByID(appID string) (*model.ApplicationView, error) {
return view.ApplicationByID(v.Db, applicationTable, appID)
func (v *View) ApplicationByID(projectID, appID string) (*model.ApplicationView, error) {
return view.ApplicationByID(v.Db, applicationTable, projectID, appID)
}
func (v *View) SearchApplications(request *proj_model.ApplicationSearchRequest) ([]*model.ApplicationView, uint64, error) {