From 8e126c46fbc12031fe29198d95c8488ed4678cdc Mon Sep 17 00:00:00 2001 From: Robin Dittmar Date: Tue, 1 Sep 2026 15:53:08 +0200 Subject: [PATCH] fix: not finding an invite in the database now produced an invalid invite error --- internal/repository/invite.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/repository/invite.go b/internal/repository/invite.go index 6932ed9..746651a 100644 --- a/internal/repository/invite.go +++ b/internal/repository/invite.go @@ -80,6 +80,9 @@ func (r *InviteRepo) GetInvite(ctx context.Context, code string) (*domain.Invite code, ).Scan(&invite.ID, &invite.Code, &invite.ExpiresAt, &invite.ConsumedAt) if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, domain.ErrInviteInvalid + } return nil, fmt.Errorf("failed to get invite: %w", err) }