From e9e2b170d79ad4b4d013643985465e22f49ab7d0 Mon Sep 17 00:00:00 2001 From: RN Date: Sun, 31 Mar 2024 18:00:52 -0700 Subject: [PATCH] fix: queries --- store/event.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/store/event.go b/store/event.go index 6527650..bafbd70 100644 --- a/store/event.go +++ b/store/event.go @@ -138,7 +138,7 @@ func (s *pgEventStore) RegisterVolunteer(ctx context.Context, eventID int, volun } if registered >= event.VolunteersRequired { - _, err := tx.ExecContext(ctx, "INSERT INTO event_signups (event_id, volunteer_id) VALUES ($1, $2)", eventID, volunteerID) + _, err := tx.ExecContext(ctx, "INSERT INTO event_signups (event_id, user_id) VALUES ($1, $2)", eventID, volunteerID) if err != nil { tx.Rollback() return fmt.Errorf("unable to register volunteer for standby with id %d, error %w", eventID, err) @@ -146,7 +146,7 @@ func (s *pgEventStore) RegisterVolunteer(ctx context.Context, eventID int, volun return tx.Commit() } - _, err = tx.ExecContext(ctx, "INSERT INTO event_signups (event_id, volunteer_id) VALUES ($1, $2)", eventID, volunteerID) + _, err = tx.ExecContext(ctx, "INSERT INTO event_signups (event_id, user_id) VALUES ($1, $2)", eventID, volunteerID) if err != nil { tx.Rollback() return fmt.Errorf("unable to register volunteer with id %d, error %w", eventID, err)