summaryrefslogtreecommitdiff
path: root/timer.go
diff options
context:
space:
mode:
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)