From f7d46e644a51ed6adf9cb2e628f2b069f339d1a6 Mon Sep 17 00:00:00 2001 From: Pavel Date: Wed, 19 Jun 2024 22:53:35 +0300 Subject: [PATCH] fix tags change matching amoid with our id, now in tag rule AMOID and matching with TAG AMOID --- internal/tools/construct.go | 2 +- tests/tools/construct_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/tools/construct.go b/internal/tools/construct.go index 86bb8aa..a46cb2e 100644 --- a/internal/tools/construct.go +++ b/internal/tools/construct.go @@ -162,7 +162,7 @@ func ConstructAmoTags(currentTags []model.Tag, ruleTags model.TagsToAdd) []model mapConstruct(ruleTags.Customer) for _, tag := range currentTags { - if _, ok := ruleTagMap[tag.ID]; ok { + if _, ok := ruleTagMap[int64(tag.Amoid)]; ok { tagsToAmo = append(tagsToAmo, models.Tag{ ID: int(tag.Amoid), Name: tag.Name, diff --git a/tests/tools/construct_test.go b/tests/tools/construct_test.go index 42ed47c..5e4949f 100644 --- a/tests/tools/construct_test.go +++ b/tests/tools/construct_test.go @@ -15,8 +15,8 @@ func Test_ConstructAmoTags(t *testing.T) { {ID: 3, Name: "Lionel Messi", Amoid: 333, Color: nil}, } ruleTags := model.TagsToAdd{ - Lead: []int64{1}, - Contact: []int64{2, 3}, + Lead: []int64{111}, + Contact: []int64{222, 3333}, Company: []int64{}, Customer: []int64{}, }