diff --git a/apier/v1/accounts.go b/apier/v1/accounts.go index 2f7d1941c..37ab332a0 100644 --- a/apier/v1/accounts.go +++ b/apier/v1/accounts.go @@ -118,10 +118,10 @@ func (self *ApierV1) GetAccountActionTriggers(attrs AttrAcntAction, reply *engin } type AttrRemAcntActionTriggers struct { - Tenant string // Tenant he account belongs to - Account string // Account name - Direction string // Traffic direction - ActionTriggerId string // Id filtering only specific id to remove (can be regexp pattern) + Tenant string // Tenant he account belongs to + Account string // Account name + Direction string // Traffic direction + ActionTriggersId string // Id filtering only specific id to remove (can be regexp pattern) } // Returns a list of ActionTriggers on an account @@ -136,8 +136,8 @@ func (self *ApierV1) RemAccountActionTriggers(attrs AttrRemAcntActionTriggers, r return 0, err } for idx, actr := range ub.ActionTriggers { - match, _ := regexp.MatchString(attrs.ActionTriggerId, actr.Id) - if len(attrs.ActionTriggerId) != 0 && !match { + match, _ := regexp.MatchString(attrs.ActionTriggersId, actr.Id) + if len(attrs.ActionTriggersId) != 0 && !match { continue } if len(ub.ActionTriggers) != 1 { // Remove by index diff --git a/apier/v1/apier_local_test.go b/apier/v1/apier_local_test.go index 070f8d018..045688f14 100644 --- a/apier/v1/apier_local_test.go +++ b/apier/v1/apier_local_test.go @@ -1090,7 +1090,7 @@ func TestApierRemAccountActionTriggers(t *testing.T) { t.Errorf("Unexpected action triggers received %v", reply) } var rmReply string - rmReq := AttrRemAcntActionTriggers{Tenant: "cgrates.org", Account: "dan2", Direction: "*out", ActionTriggerId: reply[0].Id} + rmReq := AttrRemAcntActionTriggers{Tenant: "cgrates.org", Account: "dan2", Direction: "*out", ActionTriggersId: reply[0].Id} if err := rater.Call("ApierV1.RemAccountActionTriggers", rmReq, &rmReply); err != nil { t.Error("Got error on ApierV1.RemActionTiming: ", err.Error()) } else if rmReply != OK {