diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-04-16 23:34:20 +0200 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-04-16 23:34:20 +0200 |
commit | 6dbad4dbc8702e3e09de118e17ceadae201a66f3 (patch) | |
tree | 55162396f2f0cc582e583e03eebc5974693bbb9e /timer.go | |
parent | 13a85f42183b7373296fa85319d33f1359feaea9 (diff) |
Rework addTime
Diffstat (limited to 'timer.go')
-rw-r--r-- | timer.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -363,7 +363,7 @@ func (server *MyServer) handleTimerAddTime(w http.ResponseWriter, r *http.Reques return } - duration, err := parseDuration(r.PathValue("timeToAdd")) + duration, err := parseDuration(r.FormValue("timeToAdd")) if err != nil { w.WriteHeader(http.StatusBadRequest) w.Write([]byte(err.Error())) @@ -377,7 +377,7 @@ func (server *MyServer) handleTimerAddTime(w http.ResponseWriter, r *http.Reques return } - view.TimerView(*timer).Render(context.Background(), w) + view.TimerInfo(*timer).Render(context.Background(), w) } func (server *MyServer) handleGetTimerToken(w http.ResponseWriter, r *http.Request) { @@ -559,7 +559,7 @@ func main() { http.HandleFunc("POST /login", myServer.handlePostLogin) http.HandleFunc("POST /logout", myServer.handlePostLogout) http.HandleFunc("GET /timer/{timerId}", myServer.handleTimer) - http.HandleFunc("POST /timer/{timerId}/addTime/{timeToAdd}", myServer.handleTimerAddTime) + http.HandleFunc("POST /timer/{timerId}/addTime", myServer.handleTimerAddTime) http.HandleFunc("DELETE /timer/{timerId}", myServer.handleDeleteTimer) http.HandleFunc("POST /timer/{timerId}/resetToken", myServer.handleResetTimerToken) http.HandleFunc("GET /timer/{timerId}/token", myServer.handleGetTimerToken) |