fix tags change matching amoid with our id, now in tag rule AMOID and matching with TAG AMOID

This commit is contained in:
Pavel 2024-06-19 22:53:35 +03:00
parent e7a90abacc
commit f7d46e644a
2 changed files with 3 additions and 3 deletions

@ -162,7 +162,7 @@ func ConstructAmoTags(currentTags []model.Tag, ruleTags model.TagsToAdd) []model
mapConstruct(ruleTags.Customer) mapConstruct(ruleTags.Customer)
for _, tag := range currentTags { for _, tag := range currentTags {
if _, ok := ruleTagMap[tag.ID]; ok { if _, ok := ruleTagMap[int64(tag.Amoid)]; ok {
tagsToAmo = append(tagsToAmo, models.Tag{ tagsToAmo = append(tagsToAmo, models.Tag{
ID: int(tag.Amoid), ID: int(tag.Amoid),
Name: tag.Name, Name: tag.Name,

@ -15,8 +15,8 @@ func Test_ConstructAmoTags(t *testing.T) {
{ID: 3, Name: "Lionel Messi", Amoid: 333, Color: nil}, {ID: 3, Name: "Lionel Messi", Amoid: 333, Color: nil},
} }
ruleTags := model.TagsToAdd{ ruleTags := model.TagsToAdd{
Lead: []int64{1}, Lead: []int64{111},
Contact: []int64{2, 3}, Contact: []int64{222, 3333},
Company: []int64{}, Company: []int64{},
Customer: []int64{}, Customer: []int64{},
} }