mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-21 23:28:44 +05:00
ApierV1.RemAccountActionTriggers using ActionTriggersId
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user