From 2a99f638279f12a4d97139ddb74074847b032a87 Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Sun, 20 Sep 2015 10:54:10 +0300 Subject: [PATCH] add action triggers id to set account api --- apier/v1/accounts.go | 7 +++++++ utils/apitpdata.go | 13 +++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/apier/v1/accounts.go b/apier/v1/accounts.go index 734e964d8..b9d8df241 100644 --- a/apier/v1/accounts.go +++ b/apier/v1/accounts.go @@ -182,6 +182,13 @@ func (self *ApierV1) SetAccount(attr utils.AttrSetAccount, reply *string) error at.AccountIds = append(at.AccountIds, balanceId) } } + if len(attr.ActionTriggersId) != 0 { + atrs, err := self.RatingDb.GetActionTriggers(attr.ActionTriggersId) + if err != nil { + return 0, err + } + ub.ActionTriggers = atrs + } if attr.AllowNegative != nil { ub.AllowNegative = *attr.AllowNegative } diff --git a/utils/apitpdata.go b/utils/apitpdata.go index 1c5d2af73..328c86322 100644 --- a/utils/apitpdata.go +++ b/utils/apitpdata.go @@ -1105,12 +1105,13 @@ type AttrExecuteAction struct { } type AttrSetAccount struct { - Tenant string - Direction string - Account string - ActionPlanId string - AllowNegative *bool - Disabled *bool + Tenant string + Direction string + Account string + ActionPlanId string + ActionTriggersId string + AllowNegative *bool + Disabled *bool } type AttrRemoveAccount struct {