feat: add ownerId to Organization and update related database queries; enhance CORS middleware for origin validation
This commit is contained in:
@@ -49,7 +49,7 @@ func CreateOrg(ctx context.Context, db *database.DB, userID uuid.UUID, name, slu
|
||||
if i > 0 {
|
||||
candidate = fmt.Sprintf("%s-%d", baseSlug, i+1)
|
||||
}
|
||||
org, err = db.CreateOrg(ctx, trimmedName, candidate)
|
||||
org, err = db.CreateOrg(ctx, userID, trimmedName, candidate)
|
||||
if err != nil {
|
||||
if pgErr, ok := err.(*pgconn.PgError); ok && pgErr.Code == "23505" {
|
||||
// Unique violation; try next suffix
|
||||
|
||||
Reference in New Issue
Block a user