summaryrefslogtreecommitdiffstats
path: root/cmd/npd.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/npd.go')
-rw-r--r--cmd/npd.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/cmd/npd.go b/cmd/npd.go
index 6e7ed4b..a6bd7b2 100644
--- a/cmd/npd.go
+++ b/cmd/npd.go
@@ -1,11 +1,11 @@
package cmd
import (
- "encoding/json"
"fmt"
"git.db.org.ai/dborg/internal/client"
"git.db.org.ai/dborg/internal/config"
"git.db.org.ai/dborg/internal/models"
+ "git.db.org.ai/dborg/internal/utils"
"github.com/spf13/cobra"
)
@@ -85,11 +85,5 @@ func runNPDSearch(cmd *cobra.Command, args []string) error {
return fmt.Errorf("API error: %s", response.Error)
}
- output, err := json.MarshalIndent(response.Results.Hits, "", " ")
- if err != nil {
- return fmt.Errorf("failed to format response: %w", err)
- }
-
- fmt.Println(string(output))
- return nil
+ return utils.PrintJSON(response.Results.Hits)
}