1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

refactor: split utility functions into utils and helpers

This commit is contained in:
Ferdinand Mütsch
2022-12-01 10:57:07 +01:00
parent c5fda02900
commit 21f6809f05
35 changed files with 259 additions and 236 deletions

View File

@ -1,6 +1,7 @@
package api
import (
"github.com/muety/wakapi/helpers"
"net/http"
"github.com/gorilla/mux"
@ -120,7 +121,7 @@ func (h *HeartbeatApiHandler) Post(w http.ResponseWriter, r *http.Request) {
defer func() {}()
utils.RespondJSON(w, r, http.StatusCreated, constructSuccessResponse(len(heartbeats)))
helpers.RespondJSON(w, r, http.StatusCreated, constructSuccessResponse(len(heartbeats)))
}
// construct weird response format (see https://github.com/wakatime/wakatime/blob/2e636d389bf5da4e998e05d5285a96ce2c181e3d/wakatime/api.py#L288)