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