Move voting to a new endpoint

/election/{id}/votes
This commit is contained in:
2025-01-11 18:29:01 +01:00
parent 86d7d0e881
commit cad5cfe636
8 changed files with 186 additions and 100 deletions

View File

@ -18,7 +18,7 @@ func (app *application) routes() http.Handler {
mux := http.NewServeMux()
mux.HandleFunc("POST /election", app.createElection)
mux.HandleFunc("POST /votes", app.createVotes)
mux.HandleFunc("POST /election/{id}/votes", app.createVotes)
standard := alice.New(app.recoverPanic, app.logRequest)
return standard.Then(mux)