Изменен статус get, при отсутствии записии вернет 404. В customer добавлено логгирование об ошибке

This commit is contained in:
Danil Solovyov 2023-07-26 23:43:55 +05:00
parent 84aa4d421c
commit ca791e5c5e
2 changed files with 5 additions and 2 deletions

@ -45,7 +45,10 @@ func (c *Customer) UpdateAccountVerification(userId, status string) (*models.Res
return nil, err
}
return nil, fmt.Errorf("got bad status: %v | %v", respErr.StatusCode, respErr.Message)
err = fmt.Errorf("got bad status: %v | %v", respErr.StatusCode, respErr.Message)
c.logger.Error("CustomerUpdateAccountVerification", zap.Error(err))
return nil, err
}
return &resp, nil

@ -42,7 +42,7 @@ func (r *VerificationController) GetVerification(c *fiber.Ctx) error {
}
if resp == nil {
return c.SendStatus(fiber.StatusOK)
return c.SendStatus(fiber.StatusNotFound)
}
return c.Status(fiber.StatusOK).JSON(resp)