diff options
author | 2023-11-27 14:00:57 +0000 | |
---|---|---|
committer | 2023-11-27 14:00:57 +0000 | |
commit | 74700cc8034980334e7df466f313287a41d2b8a6 (patch) | |
tree | 63ab8912c813eefba8a492e0d0489f4e5fe59446 /internal/api/client/notifications | |
parent | [chore]: Bump codeberg.org/gruf/go-mutexes from 1.3.0 to 1.3.1 (#2387) (diff) | |
download | gotosocial-74700cc8034980334e7df466f313287a41d2b8a6.tar.xz |
[performance] http response encoding / writing improvements (#2374)
Diffstat (limited to 'internal/api/client/notifications')
-rw-r--r-- | internal/api/client/notifications/notificationget.go | 2 | ||||
-rw-r--r-- | internal/api/client/notifications/notificationsclear.go | 2 | ||||
-rw-r--r-- | internal/api/client/notifications/notificationsget.go | 3 |
3 files changed, 4 insertions, 3 deletions
diff --git a/internal/api/client/notifications/notificationget.go b/internal/api/client/notifications/notificationget.go index 98e32498b..551eeca39 100644 --- a/internal/api/client/notifications/notificationget.go +++ b/internal/api/client/notifications/notificationget.go @@ -83,5 +83,5 @@ func (m *Module) NotificationGETHandler(c *gin.Context) { return } - c.JSON(http.StatusOK, resp) + apiutil.JSON(c, http.StatusOK, resp) } diff --git a/internal/api/client/notifications/notificationsclear.go b/internal/api/client/notifications/notificationsclear.go index 4b63db283..2d7da3c6b 100644 --- a/internal/api/client/notifications/notificationsclear.go +++ b/internal/api/client/notifications/notificationsclear.go @@ -75,5 +75,5 @@ func (m *Module) NotificationsClearPOSTHandler(c *gin.Context) { return } - c.JSON(http.StatusOK, struct{}{}) + apiutil.Data(c, http.StatusOK, apiutil.AppJSON, apiutil.EmptyJSONObject) } diff --git a/internal/api/client/notifications/notificationsget.go b/internal/api/client/notifications/notificationsget.go index fd175a115..da43cffec 100644 --- a/internal/api/client/notifications/notificationsget.go +++ b/internal/api/client/notifications/notificationsget.go @@ -155,5 +155,6 @@ func (m *Module) NotificationsGETHandler(c *gin.Context) { if resp.LinkHeader != "" { c.Header("Link", resp.LinkHeader) } - c.JSON(http.StatusOK, resp.Items) + + apiutil.JSON(c, http.StatusOK, resp.Items) } |