diff --git a/cmd/web/handlers.go b/cmd/web/handlers.go index b9a7b38..94fd05e 100644 --- a/cmd/web/handlers.go +++ b/cmd/web/handlers.go @@ -4,6 +4,7 @@ import ( api "code.dlmw.ch/dlmw/qv/internal" "code.dlmw.ch/dlmw/qv/internal/validator" "encoding/json" + "fmt" "math/rand" "net/http" "time" @@ -59,6 +60,7 @@ func (app *application) createElection(w http.ResponseWriter, r *http.Request) { } } + w.Header().Set("Location", fmt.Sprintf("/elections/%v", electionId)) w.Write(res) }