Refactored volunteer check_in as ready status.

This commit is contained in:
Pen Anderson 2026-03-05 17:34:50 -06:00
parent e722ef055e
commit 40ebaf07bf
7 changed files with 48 additions and 28 deletions

View file

@ -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