Skip to content

Commit

Permalink
fix: empty array is valid api config
Browse files Browse the repository at this point in the history
  • Loading branch information
sweatybridge committed Oct 21, 2024
1 parent 2da3861 commit b8c8691
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions pkg/config/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,10 @@ func (a *api) ToUpdatePostgrestConfigBody() v1API.UpdatePostgrestConfigBody {
}

// Convert Schemas to a comma-separated string
if len(a.Schemas) > 0 {
schemas := strings.Join(a.Schemas, ",")
body.DbSchema = &schemas
}
body.DbSchema = cast.Ptr(strings.Join(a.Schemas, ","))

// Convert ExtraSearchPath to a comma-separated string
if len(a.ExtraSearchPath) > 0 {
extraSearchPath := strings.Join(a.ExtraSearchPath, ",")
body.DbExtraSearchPath = &extraSearchPath
}
body.DbExtraSearchPath = cast.Ptr(strings.Join(a.ExtraSearchPath, ","))

// Convert MaxRows to int pointer
if a.MaxRows > 0 {
Expand Down

0 comments on commit b8c8691

Please sign in to comment.