fix: not finding an invite in the database now produced an invalid invite error

This commit is contained in:
2026-09-01 15:53:08 +02:00
parent 24bb87fdca
commit 8e126c46fb
+3
View File
@@ -80,6 +80,9 @@ func (r *InviteRepo) GetInvite(ctx context.Context, code string) (*domain.Invite
code, code,
).Scan(&invite.ID, &invite.Code, &invite.ExpiresAt, &invite.ConsumedAt) ).Scan(&invite.ID, &invite.Code, &invite.ExpiresAt, &invite.ConsumedAt)
if err != nil { if err != nil {
if errors.Is(err, sql.ErrNoRows) {
return nil, domain.ErrInviteInvalid
}
return nil, fmt.Errorf("failed to get invite: %w", err) return nil, fmt.Errorf("failed to get invite: %w", err)
} }