fix matching error in webhookCreate svc

This commit is contained in:
Pavel 2024-06-20 15:04:41 +03:00
parent bbabac6e8d
commit f71a339e59

@ -4,7 +4,9 @@ import (
"amocrm/internal/models"
"context"
"database/sql"
"errors"
"go.uber.org/zap"
"penahub.gitlab.yandexcloud.net/backend/quiz/common.git/pj_errors"
)
type ParamsWebhookCreate struct {
@ -17,8 +19,8 @@ type ParamsWebhookCreate struct {
func (s *Service) WebhookCreate(ctx context.Context, req ParamsWebhookCreate) error {
_, err := s.GetCurrentAccount(ctx, req.AccountID)
if err != nil && err != sql.ErrNoRows {
s.logger.Error("error checking current account in amo in webhook create")
if err != nil && !errors.Is(err, pj_errors.ErrNotFound) {
s.logger.Error("error checking current account in amo in webhook create", zap.Error(err))
return err
}