Auto-RSVP when claiming a slot

Claiming a slot now also adds the person to the going list if they
aren't already there (case-insensitive name match).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-18 22:53:17 -04:00
parent 78ac8f3677
commit 087becdf58
3 changed files with 35 additions and 0 deletions
+10
View File
@@ -310,6 +310,16 @@ func (s *Server) handleClaim(w http.ResponseWriter, r *http.Request) {
return
}
// Auto-RSVP if they're not already on the going list
_, err = s.q.GetRsvpByName(r.Context(), db.GetRsvpByNameParams{
EventID: event.ID, Name: name,
})
if err == sql.ErrNoRows {
s.q.CreateRsvp(r.Context(), db.CreateRsvpParams{
EventID: event.ID, Name: name,
})
}
s.notify(slug)
// Return updated slots partial