Commit 85ce7228 authored by boojack's avatar boojack

fix: response type

parent f80f0f24
...@@ -199,7 +199,7 @@ func (s *Server) registerMemoRoutes(g *echo.Group) { ...@@ -199,7 +199,7 @@ func (s *Server) registerMemoRoutes(g *echo.Group) {
} }
c.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSONCharsetUTF8) c.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSONCharsetUTF8)
if err := json.NewEncoder(c.Response().Writer).Encode(len(memoList)); err != nil { if err := json.NewEncoder(c.Response().Writer).Encode(composeResponse(len(memoList))); err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to encode memo amount").SetInternal(err) return echo.NewHTTPError(http.StatusInternalServerError, "Failed to encode memo amount").SetInternal(err)
} }
......
...@@ -42,7 +42,7 @@ func (s *Server) registerTagRoutes(g *echo.Group) { ...@@ -42,7 +42,7 @@ func (s *Server) registerTagRoutes(g *echo.Group) {
} }
c.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSONCharsetUTF8) c.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSONCharsetUTF8)
if err := json.NewEncoder(c.Response().Writer).Encode(tagList); err != nil { if err := json.NewEncoder(c.Response().Writer).Encode(composeResponse(tagList)); err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to encode tags response").SetInternal(err) return echo.NewHTTPError(http.StatusInternalServerError, "Failed to encode tags response").SetInternal(err)
} }
......
...@@ -221,8 +221,6 @@ func findMemoRawList(db *sql.DB, find *api.MemoFind) ([]*memoRaw, error) { ...@@ -221,8 +221,6 @@ func findMemoRawList(db *sql.DB, find *api.MemoFind) ([]*memoRaw, error) {
} }
} }
println(pagination)
rows, err := db.Query(` rows, err := db.Query(`
SELECT SELECT
id, id,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment