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:
@@ -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 = ?;
|
||||
|
||||
|
||||
@@ -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 = ?
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user