Set up Unconfirmed -> Registered -> Confirmed -> Ready flow for Volunteers
This commit is contained in:
parent
62b3dece84
commit
72b245d6d6
7 changed files with 95 additions and 20 deletions
|
|
@ -142,6 +142,20 @@ func (app *App) handleCheckInVolunteer(w http.ResponseWriter, r *http.Request) {
|
|||
writeJSON(w, v)
|
||||
}
|
||||
|
||||
func (app *App) handleConfirmVolunteer(w http.ResponseWriter, r *http.Request) {
|
||||
id, err := strconv.Atoi(r.PathValue("id"))
|
||||
if err != nil {
|
||||
writeError(w, "invalid id", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
v, err := app.confirmVolunteer(id)
|
||||
if err != nil {
|
||||
writeError(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
writeJSON(w, v)
|
||||
}
|
||||
|
||||
func (app *App) handleAssignShift(w http.ResponseWriter, r *http.Request) {
|
||||
volunteerID, err := strconv.Atoi(r.PathValue("id"))
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue