From 133c77d93b04d5f3a806c89334bcae6e6a992436 Mon Sep 17 00:00:00 2001 From: qwqtoday Date: Fri, 9 Aug 2024 19:15:20 +0800 Subject: [PATCH] make it respond with status ok --- syncapi/routing/routing.go | 19 ++++++++++--------- syncapi/routing/threads.go | 1 + 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/syncapi/routing/routing.go b/syncapi/routing/routing.go index e98e05239..c63983b41 100644 --- a/syncapi/routing/routing.go +++ b/syncapi/routing/routing.go @@ -157,16 +157,17 @@ func Setup( }, httputil.WithAllowGuests()), ).Methods(http.MethodGet, http.MethodOptions) - v1unstablemux.Handle("/rooms/{roomId}/threads", httputil.MakeAuthAPI("threads", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse { - vars, err := httputil.URLDecodeMapValues(mux.Vars(req)) - if err != nil { - return util.ErrorResponse(err) - } + v1unstablemux.Handle("/rooms/{roomId}/threads", + httputil.MakeAuthAPI("threads", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse { + vars, err := httputil.URLDecodeMapValues(mux.Vars(req)) + if err != nil { + return util.ErrorResponse(err) + } - return Threads( - req, device, syncDB, rsAPI, vars["roomId"], - ) - })).Methods(http.MethodGet) + return Threads( + req, device, syncDB, rsAPI, vars["roomId"], + ) + })).Methods(http.MethodGet) v3mux.Handle("/search", httputil.MakeAuthAPI("search", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse { diff --git a/syncapi/routing/threads.go b/syncapi/routing/threads.go index 76e50a55b..2865874a8 100644 --- a/syncapi/routing/threads.go +++ b/syncapi/routing/threads.go @@ -98,6 +98,7 @@ func Threads( } return util.JSONResponse{ + Code: http.StatusOK, JSON: res, } }