generated from PenaSide/GolangTemplate
generic after check conn return response nil, then we need check response
This commit is contained in:
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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user