fix: not finding an invite in the database now produced an invalid invite error
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user