diff --git a/internal/command/instance_custom_login_text.go b/internal/command/instance_custom_login_text.go index ca86a4829..a132b2d20 100644 --- a/internal/command/instance_custom_login_text.go +++ b/internal/command/instance_custom_login_text.go @@ -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 diff --git a/internal/command/instance_custom_login_text_test.go b/internal/command/instance_custom_login_text_test.go index abdaf7307..57efbf43d 100644 --- a/internal/command/instance_custom_login_text_test.go +++ b/internal/command/instance_custom_login_text_test.go @@ -38,7 +38,6 @@ func TestCommandSide_SetCustomIAMLoginText(t *testing.T) { eventstore: eventstoreExpect( t, expectFilter(), - expectPush(), ), }, args: args{ diff --git a/internal/command/instance_custom_message_text.go b/internal/command/instance_custom_message_text.go index 03c073e4d..f8b4ed317 100644 --- a/internal/command/instance_custom_message_text.go +++ b/internal/command/instance_custom_message_text.go @@ -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 diff --git a/internal/command/instance_custom_message_text_test.go b/internal/command/instance_custom_message_text_test.go index edb330c6a..76f463ae0 100644 --- a/internal/command/instance_custom_message_text_test.go +++ b/internal/command/instance_custom_message_text_test.go @@ -54,7 +54,6 @@ func TestCommandSide_SetDefaultMessageText(t *testing.T) { eventstore: eventstoreExpect( t, expectFilter(), - expectPush(), ), }, args: args{ diff --git a/internal/command/org_custom_login_text.go b/internal/command/org_custom_login_text.go index b3d52c669..1f906972b 100644 --- a/internal/command/org_custom_login_text.go +++ b/internal/command/org_custom_login_text.go @@ -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 diff --git a/internal/command/org_custom_login_text_test.go b/internal/command/org_custom_login_text_test.go index 0411a533a..81f7c308d 100644 --- a/internal/command/org_custom_login_text_test.go +++ b/internal/command/org_custom_login_text_test.go @@ -56,7 +56,6 @@ func TestCommandSide_SetCustomOrgLoginText(t *testing.T) { eventstore: eventstoreExpect( t, expectFilter(), - expectPush(), ), }, args: args{ diff --git a/internal/command/org_custom_message_text.go b/internal/command/org_custom_message_text.go index cd9fc2da9..266b50209 100644 --- a/internal/command/org_custom_message_text.go +++ b/internal/command/org_custom_message_text.go @@ -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 diff --git a/internal/command/org_custom_message_text_test.go b/internal/command/org_custom_message_text_test.go index 424a88779..ffa8d87ae 100644 --- a/internal/command/org_custom_message_text_test.go +++ b/internal/command/org_custom_message_text_test.go @@ -67,7 +67,6 @@ func TestCommandSide_SetCustomMessageText(t *testing.T) { eventstore: eventstoreExpect( t, expectFilter(), - expectPush(), ), }, args: args{