Refactored volunteer check_in as ready status.
This commit is contained in:
parent
e722ef055e
commit
40ebaf07bf
7 changed files with 48 additions and 28 deletions
|
|
@ -130,14 +130,14 @@ func (app *App) handleDeleteVolunteer(w http.ResponseWriter, r *http.Request) {
|
|||
w.WriteHeader(http.StatusNoContent)
|
||||
}
|
||||
|
||||
func (app *App) handleCheckInVolunteer(w http.ResponseWriter, r *http.Request) {
|
||||
func (app *App) handleMarkVolunteerReady(w http.ResponseWriter, r *http.Request) {
|
||||
id, err := strconv.Atoi(r.PathValue("id"))
|
||||
if err != nil {
|
||||
writeError(w, "invalid id", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
claims := claimsFromContext(r)
|
||||
v, err := app.checkInVolunteer(id, claims.UserID)
|
||||
v, err := app.markVolunteerReady(id, claims.UserID)
|
||||
if err != nil {
|
||||
writeError(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue