Set Location header after creating an election
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user