mirror of
https://github.com/zitadel/zitadel.git
synced 2025-07-29 21:03:55 +00:00
fix: template removed events on projections (#2863)
This commit is contained in:
parent
cc04067da3
commit
28d7acdf99
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/caos/logging"
|
"github.com/caos/logging"
|
||||||
|
|
||||||
"github.com/caos/zitadel/internal/errors"
|
"github.com/caos/zitadel/internal/errors"
|
||||||
"github.com/caos/zitadel/internal/eventstore"
|
"github.com/caos/zitadel/internal/eventstore"
|
||||||
"github.com/caos/zitadel/internal/eventstore/handler"
|
"github.com/caos/zitadel/internal/eventstore/handler"
|
||||||
@ -144,6 +145,6 @@ func (p *CustomTextProjection) reduceTemplateRemoved(event eventstore.EventReade
|
|||||||
[]handler.Condition{
|
[]handler.Condition{
|
||||||
handler.NewCond(CustomTextAggregateIDCol, customTextEvent.Aggregate().ID),
|
handler.NewCond(CustomTextAggregateIDCol, customTextEvent.Aggregate().ID),
|
||||||
handler.NewCond(CustomTextTemplateCol, customTextEvent.Template),
|
handler.NewCond(CustomTextTemplateCol, customTextEvent.Template),
|
||||||
handler.NewCond(CustomTextLanguageCol, customTextEvent.Language),
|
handler.NewCond(CustomTextLanguageCol, customTextEvent.Language.String()),
|
||||||
}), nil
|
}), nil
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ import (
|
|||||||
"github.com/caos/zitadel/internal/eventstore/repository"
|
"github.com/caos/zitadel/internal/eventstore/repository"
|
||||||
"github.com/caos/zitadel/internal/repository/iam"
|
"github.com/caos/zitadel/internal/repository/iam"
|
||||||
"github.com/caos/zitadel/internal/repository/org"
|
"github.com/caos/zitadel/internal/repository/org"
|
||||||
"golang.org/x/text/language"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCustomTextProjection_reduces(t *testing.T) {
|
func TestCustomTextProjection_reduces(t *testing.T) {
|
||||||
@ -122,7 +121,7 @@ func TestCustomTextProjection_reduces(t *testing.T) {
|
|||||||
expectedArgs: []interface{}{
|
expectedArgs: []interface{}{
|
||||||
"agg-id",
|
"agg-id",
|
||||||
"InitCode",
|
"InitCode",
|
||||||
language.English,
|
"en",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -229,7 +228,7 @@ func TestCustomTextProjection_reduces(t *testing.T) {
|
|||||||
expectedArgs: []interface{}{
|
expectedArgs: []interface{}{
|
||||||
"agg-id",
|
"agg-id",
|
||||||
"InitCode",
|
"InitCode",
|
||||||
language.English,
|
"en",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -10,7 +10,6 @@ import (
|
|||||||
"github.com/caos/zitadel/internal/eventstore/repository"
|
"github.com/caos/zitadel/internal/eventstore/repository"
|
||||||
"github.com/caos/zitadel/internal/repository/iam"
|
"github.com/caos/zitadel/internal/repository/iam"
|
||||||
"github.com/caos/zitadel/internal/repository/org"
|
"github.com/caos/zitadel/internal/repository/org"
|
||||||
"golang.org/x/text/language"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMessageTextProjection_reduces(t *testing.T) {
|
func TestMessageTextProjection_reduces(t *testing.T) {
|
||||||
@ -574,7 +573,7 @@ func TestMessageTextProjection_reduces(t *testing.T) {
|
|||||||
expectedArgs: []interface{}{
|
expectedArgs: []interface{}{
|
||||||
"agg-id",
|
"agg-id",
|
||||||
"InitCode",
|
"InitCode",
|
||||||
language.English,
|
"en",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/caos/logging"
|
"github.com/caos/logging"
|
||||||
|
|
||||||
"github.com/caos/zitadel/internal/domain"
|
"github.com/caos/zitadel/internal/domain"
|
||||||
"github.com/caos/zitadel/internal/errors"
|
"github.com/caos/zitadel/internal/errors"
|
||||||
"github.com/caos/zitadel/internal/eventstore"
|
"github.com/caos/zitadel/internal/eventstore"
|
||||||
@ -198,7 +199,7 @@ func (p *MessageTextProjection) reduceTemplateRemoved(event eventstore.EventRead
|
|||||||
[]handler.Condition{
|
[]handler.Condition{
|
||||||
handler.NewCond(MessageTextAggregateIDCol, templateEvent.Aggregate().ID),
|
handler.NewCond(MessageTextAggregateIDCol, templateEvent.Aggregate().ID),
|
||||||
handler.NewCond(MessageTextTypeCol, templateEvent.Template),
|
handler.NewCond(MessageTextTypeCol, templateEvent.Template),
|
||||||
handler.NewCond(MessageTextLanguageCol, templateEvent.Language),
|
handler.NewCond(MessageTextLanguageCol, templateEvent.Language.String()),
|
||||||
},
|
},
|
||||||
), nil
|
), nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user