From 74700cc8034980334e7df466f313287a41d2b8a6 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Mon, 27 Nov 2023 14:00:57 +0000 Subject: [performance] http response encoding / writing improvements (#2374) --- internal/api/client/reports/reportcreate.go | 2 +- internal/api/client/reports/reportget.go | 2 +- internal/api/client/reports/reportsget.go | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'internal/api/client/reports') diff --git a/internal/api/client/reports/reportcreate.go b/internal/api/client/reports/reportcreate.go index a4fa01148..a34b8d52e 100644 --- a/internal/api/client/reports/reportcreate.go +++ b/internal/api/client/reports/reportcreate.go @@ -107,5 +107,5 @@ func (m *Module) ReportPOSTHandler(c *gin.Context) { return } - c.JSON(http.StatusOK, apiReport) + apiutil.JSON(c, http.StatusOK, apiReport) } diff --git a/internal/api/client/reports/reportget.go b/internal/api/client/reports/reportget.go index 0d5d16da2..4a9b06664 100644 --- a/internal/api/client/reports/reportget.go +++ b/internal/api/client/reports/reportget.go @@ -90,5 +90,5 @@ func (m *Module) ReportGETHandler(c *gin.Context) { return } - c.JSON(http.StatusOK, report) + apiutil.JSON(c, http.StatusOK, report) } diff --git a/internal/api/client/reports/reportsget.go b/internal/api/client/reports/reportsget.go index e290608eb..ba47f1b8b 100644 --- a/internal/api/client/reports/reportsget.go +++ b/internal/api/client/reports/reportsget.go @@ -168,5 +168,6 @@ func (m *Module) ReportsGETHandler(c *gin.Context) { if resp.LinkHeader != "" { c.Header("Link", resp.LinkHeader) } - c.JSON(http.StatusOK, resp.Items) + + apiutil.JSON(c, http.StatusOK, resp.Items) } -- cgit v1.2.3