diff --git a/internal/command/command.go b/internal/command/command.go index 911fef0be7..25df7c033b 100644 --- a/internal/command/command.go +++ b/internal/command/command.go @@ -67,7 +67,7 @@ func StartCommands(es *eventstore.Eventstore, oidcEncryption crypto.EncryptionAlgorithm, ) (repo *Commands, err error) { if externalDomain == "" { - return nil, errors.ThrowInvalidArgument(nil, "COMMAND-Df21s", "not external domain specified") + return nil, errors.ThrowInvalidArgument(nil, "COMMAND-Df21s", "no external domain specified") } repo = &Commands{ eventstore: es, diff --git a/internal/command/org_member.go b/internal/command/org_member.go index 72222e61e4..fd29c84059 100644 --- a/internal/command/org_member.go +++ b/internal/command/org_member.go @@ -25,7 +25,7 @@ func (c *Commands) AddOrgMemberCommand(a *org.Aggregate, userID string, roles .. return nil, errors.ThrowInvalidArgument(nil, "Org-4N8es", "Errors.Org.MemberInvalid") } return func(ctx context.Context, filter preparation.FilterToQueryReducer) ([]eventstore.Command, error) { - if exists, err := ExistsUser(ctx, filter, userID, a.ID); err != nil || !exists { + if exists, err := ExistsUser(ctx, filter, userID, ""); err != nil || !exists { return nil, errors.ThrowPreconditionFailed(err, "ORG-GoXOn", "Errors.User.NotFound") } if isMember, err := IsOrgMember(ctx, filter, a.ID, userID); err != nil || isMember { @@ -73,7 +73,7 @@ func IsOrgMember(ctx context.Context, filter preparation.FilterToQueryReducer, o return isMember, nil } -func (c *Commands) AddOrgMember(ctx context.Context, userID, orgID string, roles ...string) (*domain.Member, error) { +func (c *Commands) AddOrgMember(ctx context.Context, orgID, userID string, roles ...string) (*domain.Member, error) { orgAgg := org.NewAggregate(orgID) cmds, err := preparation.PrepareCommands(ctx, c.eventstore.Filter, c.AddOrgMemberCommand(orgAgg, userID, roles...)) if err != nil { diff --git a/internal/command/org_member_test.go b/internal/command/org_member_test.go index ab96705992..59c235e9fa 100644 --- a/internal/command/org_member_test.go +++ b/internal/command/org_member_test.go @@ -519,7 +519,7 @@ func TestCommandSide_AddOrgMember(t *testing.T) { eventstore: tt.fields.eventstore, zitadelRoles: tt.fields.zitadelRoles, } - got, err := r.AddOrgMember(tt.args.ctx, tt.args.userID, tt.args.orgID, tt.args.roles...) + got, err := r.AddOrgMember(tt.args.ctx, tt.args.orgID, tt.args.userID, tt.args.roles...) if tt.res.err == nil { assert.NoError(t, err) }