generic after check conn return response nil, then we need check response

This commit is contained in:
Pavel 2024-10-20 17:07:13 +03:00
parent f92d613124
commit ffe097de77

@ -47,15 +47,17 @@ func (receiver *VerificationClient) GetVerification(ctx context.Context, token,
}
response, err := client.Get[models.Verification, models.FastifyError](ctx, &client.RequestSettings{
URL: verifURL,
URL: verifURL,
Headers: map[string]string{
"Content-Type": "application/json",
"Authorization": token,
},
"Content-Type": "application/json",
"Authorization": token,
},
})
if err != nil {
if response.StatusCode == 404 {
return &models.Verification{},nil
if response != nil {
if response.StatusCode == 404 {
return &models.Verification{}, nil
}
}
return nil, errors.New(err, errors.ErrInternalError)
}