summaryrefslogtreecommitdiff
path: root/timer.go
diff options
context:
space:
mode:
authorSteven Le Rouzic <steven.lerouzic@gmail.com>2024-04-16 23:34:20 +0200
committerSteven Le Rouzic <steven.lerouzic@gmail.com>2024-04-16 23:34:20 +0200
commit6dbad4dbc8702e3e09de118e17ceadae201a66f3 (patch)
tree55162396f2f0cc582e583e03eebc5974693bbb9e /timer.go
parent13a85f42183b7373296fa85319d33f1359feaea9 (diff)
Rework addTime
Diffstat (limited to 'timer.go')
-rw-r--r--timer.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/timer.go b/timer.go
index 97dc964..f215377 100644
--- a/timer.go
+++ b/timer.go
@@ -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)