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:
+10
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user