mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-23 08:08:45 +05:00
Renamed RemSupplierProfile to RemoveSupplierProfile
This commit is contained in:
@@ -1339,13 +1339,13 @@ func testV1FIdxRemoveSupplierProfile(t *testing.T) {
|
||||
if reply2 != utils.OK {
|
||||
t.Errorf("Error: %+v", reply2)
|
||||
}
|
||||
if err := tFIdxRpc.Call("ApierV1.RemSupplierProfile",
|
||||
if err := tFIdxRpc.Call("ApierV1.RemoveSupplierProfile",
|
||||
&utils.TenantID{Tenant: tenant, ID: "TEST_PROFILE1"}, &resp); err != nil {
|
||||
t.Error(err)
|
||||
} else if resp != utils.OK {
|
||||
t.Error("Unexpected reply returned", resp)
|
||||
}
|
||||
if err := tFIdxRpc.Call("ApierV1.RemSupplierProfile",
|
||||
if err := tFIdxRpc.Call("ApierV1.RemoveSupplierProfile",
|
||||
&utils.TenantID{Tenant: tenant, ID: "TEST_PROFILE2"}, &resp); err != nil {
|
||||
t.Error(err)
|
||||
} else if resp != utils.OK {
|
||||
|
||||
@@ -51,8 +51,8 @@ func (apierV1 *ApierV1) SetSupplierProfile(spp *engine.SupplierProfile, reply *s
|
||||
return nil
|
||||
}
|
||||
|
||||
//RemSupplierProfile remove a specific Supplier configuration
|
||||
func (apierV1 *ApierV1) RemSupplierProfile(arg utils.TenantID, reply *string) error {
|
||||
//RemoveSupplierProfile remove a specific Supplier configuration
|
||||
func (apierV1 *ApierV1) RemoveSupplierProfile(arg utils.TenantID, reply *string) error {
|
||||
if missing := utils.MissingStructFields(&arg, []string{"Tenant", "ID"}); len(missing) != 0 { //Params missing
|
||||
return utils.NewErrMandatoryIeMissing(missing...)
|
||||
}
|
||||
|
||||
@@ -357,7 +357,7 @@ func testV1SplSUpdateSupplierProfiles(t *testing.T) {
|
||||
|
||||
func testV1SplSRemSupplierProfiles(t *testing.T) {
|
||||
var resp string
|
||||
if err := splSv1Rpc.Call("ApierV1.RemSupplierProfile", &utils.TenantID{Tenant: "cgrates.org", ID: "TEST_PROFILE1"}, &resp); err != nil {
|
||||
if err := splSv1Rpc.Call("ApierV1.RemoveSupplierProfile", &utils.TenantID{Tenant: "cgrates.org", ID: "TEST_PROFILE1"}, &resp); err != nil {
|
||||
t.Error(err)
|
||||
} else if resp != utils.OK {
|
||||
t.Error("Unexpected reply returned", resp)
|
||||
|
||||
@@ -23,7 +23,7 @@ import "github.com/cgrates/cgrates/utils"
|
||||
func init() {
|
||||
c := &CmdRemoveSupplier{
|
||||
name: "supplier_remove",
|
||||
rpcMethod: "ApierV1.RemSupplierProfile",
|
||||
rpcMethod: "ApierV1.RemoveSupplierProfile",
|
||||
rpcParams: &utils.TenantID{},
|
||||
}
|
||||
commands[c.Name()] = c
|
||||
|
||||
@@ -2253,6 +2253,7 @@ func (ms *MongoStorage) SetThresholdProfileDrv(tp *ThresholdProfile) (err error)
|
||||
func (ms *MongoStorage) RemThresholdProfileDrv(tenant, id string) (err error) {
|
||||
session, col := ms.conn(colTps)
|
||||
defer session.Close()
|
||||
utils.Logger.Debug(fmt.Sprintf("dbKey %+v", session))
|
||||
err = col.Remove(bson.M{"tenant": tenant, "id": id})
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user