From b8c869128c9897a0c9f15a4da0a2df467bfcf811 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Mon, 21 Oct 2024 23:20:08 +0800 Subject: [PATCH] fix: empty array is valid api config --- pkg/config/api.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pkg/config/api.go b/pkg/config/api.go index 403e290e5..cb94959a6 100644 --- a/pkg/config/api.go +++ b/pkg/config/api.go @@ -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 {