diff --git a/pkg/probo/coredata/organization.go b/pkg/probo/coredata/organization.go index 3c16ea7a8..5b1b6f572 100644 --- a/pkg/probo/coredata/organization.go +++ b/pkg/probo/coredata/organization.go @@ -79,7 +79,6 @@ LIMIT 1; func (o *Organization) Insert( ctx context.Context, conn pg.Conn, - scope Scoper, ) error { q := ` INSERT INTO organizations ( @@ -93,7 +92,7 @@ INSERT INTO organizations ( ` args := pgx.StrictNamedArgs{ - "tenant_id": scope.GetTenantID(), + "tenant_id": o.ID, // We use the organization ID as tenant ID "id": o.ID, "name": o.Name, "logo_url": o.LogoURL, diff --git a/pkg/probo/create_organization.go b/pkg/probo/create_organization.go index 572e6f12a..ae062571a 100644 --- a/pkg/probo/create_organization.go +++ b/pkg/probo/create_organization.go @@ -50,7 +50,7 @@ func (s Service) CreateOrganization( err = s.pg.WithConn( ctx, func(conn pg.Conn) error { - if err := organization.Insert(ctx, conn, s.scope); err != nil { + if err := organization.Insert(ctx, conn); err != nil { return fmt.Errorf("cannot insert control: %w", err) }