diff --git a/core/organization/service.go b/core/organization/service.go index 24af40bbd..a81b491e8 100644 --- a/core/organization/service.go +++ b/core/organization/service.go @@ -184,6 +184,11 @@ func (s Service) AddMember(ctx context.Context, orgID, relationName string, prin }); err != nil { return err } + + audit.GetAuditor(ctx, orgID).Log(audit.OrgMemberCreatedEvent, audit.Target{ + ID: principal.ID, + Type: principal.Type, + }) return nil } diff --git a/internal/api/v1beta1/org.go b/internal/api/v1beta1/org.go index 819d62835..2558f5173 100644 --- a/internal/api/v1beta1/org.go +++ b/internal/api/v1beta1/org.go @@ -382,10 +382,6 @@ func (h Handler) AddOrganizationUsers(ctx context.Context, request *frontierv1be } } - for _, userID := range request.GetUserIds() { - audit.GetAuditor(ctx, orgResp.ID).Log(audit.OrgMemberCreatedEvent, audit.UserTarget(userID)) - } - if err := h.orgService.AddUsers(ctx, orgResp.ID, request.GetUserIds()); err != nil { return nil, err }