Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: empty array is valid api config #2788

Merged
merged 3 commits into from
Oct 21, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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, ","))
sweatybridge marked this conversation as resolved.
Show resolved Hide resolved

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