Delete auto-RSVP on unclaim and count going from RSVPs only

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-18 23:15:48 -04:00
parent 6e3fc9721a
commit e7022124be
3 changed files with 36 additions and 9 deletions
+3
View File
@@ -49,6 +49,9 @@ INSERT INTO claims (slot_id, name, note)
VALUES (?, ?, ?)
RETURNING *;
-- name: GetClaimByID :one
SELECT * FROM claims WHERE id = ?;
-- name: DeleteClaim :exec
DELETE FROM claims WHERE id = ?;
+17
View File
@@ -295,6 +295,23 @@ func (q *Queries) DeleteSlot(ctx context.Context, id int64) error {
return err
}
const getClaimByID = `-- name: GetClaimByID :one
SELECT id, slot_id, name, note, created_at FROM claims WHERE id = ?
`
func (q *Queries) GetClaimByID(ctx context.Context, id int64) (Claim, error) {
row := q.db.QueryRowContext(ctx, getClaimByID, id)
var i Claim
err := row.Scan(
&i.ID,
&i.SlotID,
&i.Name,
&i.Note,
&i.CreatedAt,
)
return i, err
}
const getEventByAdminToken = `-- name: GetEventByAdminToken :one
SELECT id, slug, title, date, time, location, admin_token, description, user_id, created_at FROM events WHERE admin_token = ?
`