mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-25 13:58:46 +00:00
fix: push events (#1262)
* fix: push events instead of aggregates * fix: tests * try without aggregate methods and with aggregate methods * fix: change push aggregate to push events * fix: change push aggregate to push events * fix: change push aggregate to push events * fix: change push aggregate to push events * fix: change push aggregate to push events * fix: change push aggregate to push events * fix: change push aggregate to push events * fix: change push aggregate to push events * fix: change push aggregate to push events * fix: change push aggregate to push events * fix: client secret * fix: query eventtypes * fix: query eventtypes * fix: eventstore index * fix: index * fix: merge new eventstore * fix: remove unnecessary todos * fix: remove unnecessary todos Co-authored-by: Fabiennne <[email protected]>
This commit is contained in:
@@ -15,9 +15,8 @@ type WriteModel struct {
|
||||
|
||||
//AppendEvents adds all the events to the read model.
|
||||
// The function doesn't compute the new state of the read model
|
||||
func (rm *WriteModel) AppendEvents(events ...EventReader) *WriteModel {
|
||||
func (rm *WriteModel) AppendEvents(events ...EventReader) {
|
||||
rm.Events = append(rm.Events, events...)
|
||||
return rm
|
||||
}
|
||||
|
||||
//Reduce is the basic implementaion of reducer
|
||||
@@ -28,10 +27,10 @@ func (wm *WriteModel) Reduce() error {
|
||||
}
|
||||
|
||||
if wm.AggregateID == "" {
|
||||
wm.AggregateID = wm.Events[0].AggregateID()
|
||||
wm.AggregateID = wm.Events[0].Aggregate().ID
|
||||
}
|
||||
if wm.ResourceOwner == "" {
|
||||
wm.ResourceOwner = wm.Events[0].ResourceOwner()
|
||||
wm.ResourceOwner = wm.Events[0].Aggregate().ResourceOwner
|
||||
}
|
||||
|
||||
wm.ProcessedSequence = wm.Events[len(wm.Events)-1].Sequence()
|
||||
|
||||
Reference in New Issue
Block a user