mirror of
https://github.com/zitadel/zitadel
synced 2024-11-22 00:39:36 +00:00
fix: empty custom text changes push no events (#8054)
# Which Problems Are Solved If there is no custom text given, the call ends in an internal error as no events have to be pushed. # How the Problems Are Solved If no events have to be pushed, no trying to push an empty list of events. # Additional Changes No additional changes. # Additional Context Closes #6954
This commit is contained in:
parent
7576f09de6
commit
04fc59f538
@ -21,6 +21,9 @@ func (c *Commands) SetCustomInstanceLoginText(ctx context.Context, loginText *do
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(events) == 0 {
|
||||
return writeModelToObjectDetails(&existingMailText.WriteModel), nil
|
||||
}
|
||||
pushedEvents, err := c.eventstore.Push(ctx, events...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -38,7 +38,6 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) {
|
||||
eventstore: eventstoreExpect(
|
||||
t,
|
||||
expectFilter(),
|
||||
expectPush(),
|
||||
),
|
||||
},
|
||||
args: args{
|
||||
|
@ -21,6 +21,9 @@ func (c *Commands) SetDefaultMessageText(ctx context.Context, instanceID string,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(events) == 0 {
|
||||
return writeModelToObjectDetails(&existingMessageText.WriteModel), nil
|
||||
}
|
||||
pushedEvents, err := c.eventstore.Push(ctx, events...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -54,7 +54,6 @@ func TestCommandSide_SetDefaultMessageText(t *testing.T) {
|
||||
eventstore: eventstoreExpect(
|
||||
t,
|
||||
expectFilter(),
|
||||
expectPush(),
|
||||
),
|
||||
},
|
||||
args: args{
|
||||
|
@ -23,6 +23,9 @@ func (c *Commands) SetOrgLoginText(ctx context.Context, resourceOwner string, lo
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(events) == 0 {
|
||||
return writeModelToObjectDetails(&existingLoginText.WriteModel), nil
|
||||
}
|
||||
pushedEvents, err := c.eventstore.Push(ctx, events...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -56,7 +56,6 @@ func TestCommandSide_SetCustomOrgLoginText(t *testing.T) {
|
||||
eventstore: eventstoreExpect(
|
||||
t,
|
||||
expectFilter(),
|
||||
expectPush(),
|
||||
),
|
||||
},
|
||||
args: args{
|
||||
|
@ -23,6 +23,9 @@ func (c *Commands) SetOrgMessageText(ctx context.Context, resourceOwner string,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(events) == 0 {
|
||||
return writeModelToObjectDetails(&existingMessageText.WriteModel), nil
|
||||
}
|
||||
pushedEvents, err := c.eventstore.Push(ctx, events...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -67,7 +67,6 @@ func TestCommandSide_SetCustomMessageText(t *testing.T) {
|
||||
eventstore: eventstoreExpect(
|
||||
t,
|
||||
expectFilter(),
|
||||
expectPush(),
|
||||
),
|
||||
},
|
||||
args: args{
|
||||
|
Loading…
Reference in New Issue
Block a user