Fix organization profile using owner's full name instead of org name

When creating an organization, the owner's membership profile was being set with the organization name as the full name instead of the owner's actual full name. Fetch the identity's full name and use it for the profile.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-03-19 11:38:04 +01:00
parent dd99eec4f6
commit b87ea87c42

View File

@@ -462,7 +462,6 @@ func (s *OrganizationService) CreateOrganization(
OrganizationID: organization.ID,
Source: coredata.ProfileSourceManual,
State: coredata.ProfileStateActive,
FullName: req.Name,
CreatedAt: now,
UpdatedAt: now,
}
@@ -590,6 +589,8 @@ func (s *OrganizationService) CreateOrganization(
return fmt.Errorf("cannot load identity: %w", err)
}
profile.FullName = identity.FullName
err = organization.Insert(ctx, tx)
if err != nil {
return fmt.Errorf("cannot insert organization: %w", err)