mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-15 12:27:59 +00:00
1ac1492fd3
* fix: handle multiple statements for a single event in projections * export func type * fix test * Update internal/eventstore/handler/crdb/statement.go Co-authored-by: Silvan <silvan.reusser@gmail.com> * Update internal/eventstore/handler/crdb/statement.go Co-authored-by: Silvan <silvan.reusser@gmail.com> * change to pointers * add error test case Co-authored-by: Silvan <silvan.reusser@gmail.com>
17 lines
381 B
Go
17 lines
381 B
Go
package crdb
|
|
|
|
import (
|
|
"github.com/caos/zitadel/internal/eventstore"
|
|
"github.com/caos/zitadel/internal/eventstore/handler"
|
|
)
|
|
|
|
//reduce implements handler.Reduce function
|
|
func (h *StatementHandler) reduce(event eventstore.EventReader) (*handler.Statement, error) {
|
|
reduce, ok := h.reduces[event.Type()]
|
|
if !ok {
|
|
return NewNoOpStatement(event), nil
|
|
}
|
|
|
|
return reduce(event)
|
|
}
|