mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
renamed RemActions API to RemoveActions
This commit is contained in:
@@ -1066,11 +1066,11 @@ func (self *ApierV1) GetLoadHistory(attrs utils.Paginator, reply *[]*engine.Load
|
||||
return nil
|
||||
}
|
||||
|
||||
type AttrRemActions struct {
|
||||
type AttrRemoveActions struct {
|
||||
ActionIDs []string
|
||||
}
|
||||
|
||||
func (self *ApierV1) RemActions(attr AttrRemActions, reply *string) error {
|
||||
func (self *ApierV1) RemoveActions(attr AttrRemoveActions, reply *string) error {
|
||||
if attr.ActionIDs == nil {
|
||||
err := utils.ErrNotFound
|
||||
*reply = err.Error()
|
||||
|
||||
@@ -23,7 +23,7 @@ import "github.com/cgrates/cgrates/apier/v1"
|
||||
func init() {
|
||||
c := &CmdRemoveActions{
|
||||
name: "actions_remove",
|
||||
rpcMethod: "ApierV1.RemActions",
|
||||
rpcMethod: "ApierV1.RemoveActions",
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
c.CommandExecuter = &CommandExecuter{c}
|
||||
@@ -33,7 +33,7 @@ func init() {
|
||||
type CmdRemoveActions struct {
|
||||
name string
|
||||
rpcMethod string
|
||||
rpcParams *v1.AttrRemActions
|
||||
rpcParams *v1.AttrRemoveActions
|
||||
*CommandExecuter
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ func (self *CmdRemoveActions) RpcMethod() string {
|
||||
|
||||
func (self *CmdRemoveActions) RpcParams(reset bool) interface{} {
|
||||
if reset || self.rpcParams == nil {
|
||||
self.rpcParams = &v1.AttrRemActions{}
|
||||
self.rpcParams = &v1.AttrRemoveActions{}
|
||||
}
|
||||
return self.rpcParams
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ func TestTpCreateExecuteActionMatch(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestTpSetRemActions(t *testing.T) {
|
||||
func TestTpSetRemoveActions(t *testing.T) {
|
||||
if !*testIntegration {
|
||||
return
|
||||
}
|
||||
@@ -323,12 +323,12 @@ func TestTpSetRemActions(t *testing.T) {
|
||||
} else if len(actionsMap) != 1 {
|
||||
t.Errorf("Calling ApierV2.GetActions got reply: %s", utils.ToIJSON(actionsMap))
|
||||
}
|
||||
if err := tpRPC.Call("ApierV2.RemActions", v1.AttrRemActions{
|
||||
if err := tpRPC.Call("ApierV2.RemoveActions", v1.AttrRemoveActions{
|
||||
ActionIDs: []string{"PAYMENT_2056bd2fe137082970f97102b64e42fd"},
|
||||
}, &reply); err != nil {
|
||||
t.Error("Got error on ApierV2.RemActions: ", err.Error())
|
||||
t.Error("Got error on ApierV2.RemoveActions: ", err.Error())
|
||||
} else if reply != utils.OK {
|
||||
t.Errorf("Calling ApierV2.RemActions got reply: %s", reply)
|
||||
t.Errorf("Calling ApierV2.RemoveActions got reply: %s", reply)
|
||||
}
|
||||
if err := tpRPC.Call("ApierV2.GetActions", v2.AttrGetActions{
|
||||
ActionIDs: []string{"PAYMENT_2056bd2fe137082970f97102b64e42fd"},
|
||||
@@ -337,7 +337,7 @@ func TestTpSetRemActions(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestTpRemActionsRefenced(t *testing.T) {
|
||||
func TestTpRemoveActionsRefenced(t *testing.T) {
|
||||
if !*testIntegration {
|
||||
return
|
||||
}
|
||||
@@ -353,12 +353,12 @@ func TestTpRemActionsRefenced(t *testing.T) {
|
||||
t.Errorf("Calling ApierV2.GetActions got reply: %s", utils.ToIJSON(actionsMap))
|
||||
}
|
||||
var reply string
|
||||
if err := tpRPC.Call("ApierV2.RemActions", v1.AttrRemActions{
|
||||
if err := tpRPC.Call("ApierV2.RemoveActions", v1.AttrRemoveActions{
|
||||
ActionIDs: []string{"TOPUP_VOICE"},
|
||||
}, &reply); err != nil {
|
||||
t.Error("Error on ApierV2.RemActions: ", err.Error())
|
||||
t.Error("Error on ApierV2.RemoveActions: ", err.Error())
|
||||
} else if reply != utils.OK {
|
||||
t.Errorf("Calling ApierV2.RemActions got reply: %s", reply)
|
||||
t.Errorf("Calling ApierV2.RemoveActions got reply: %s", reply)
|
||||
}
|
||||
if err := tpRPC.Call("ApierV2.GetActions", v2.AttrGetActions{
|
||||
ActionIDs: []string{"PAYMENT_2056bd2fe137082970f97102b64e42fd"},
|
||||
|
||||
Reference in New Issue
Block a user