Fix bootstrap organization failed

We use organization id as tenant id, so the organization insert cannot
take scope as it self scoped tenant.

Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
gearnode
2025-03-10 10:29:10 +01:00
parent a4611f5433
commit b2b1305abe
2 changed files with 2 additions and 3 deletions

View File

@@ -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,

View File

@@ -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)
}