mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
fix get all eaction plans keys
This commit is contained in:
@@ -194,7 +194,7 @@ func (self *ApierV1) SetAccount(attr utils.AttrSetAccount, reply *string) error
|
||||
return 0, err
|
||||
}
|
||||
for actionPlanID, ap := range actionPlansMap {
|
||||
if actionPlanID[len(utils.ACTION_PLAN_PREFIX):] == attr.ActionPlanId {
|
||||
if actionPlanID == attr.ActionPlanId {
|
||||
// don't remove it if it's the current one
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ package v2
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"math"
|
||||
|
||||
"github.com/cgrates/cgrates/engine"
|
||||
@@ -129,7 +130,6 @@ func (self *ApierV2) SetAccount(attr AttrSetAccount, reply *string) error {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for _, actionPlanID := range *attr.ActionPlanIDs {
|
||||
ap, ok := actionPlansMap[actionPlanID]
|
||||
if !ok {
|
||||
@@ -157,6 +157,7 @@ func (self *ApierV2) SetAccount(attr AttrSetAccount, reply *string) error {
|
||||
}
|
||||
}
|
||||
}
|
||||
log.Print(5)
|
||||
for actionPlanID, ap := range dirtyActionPlans {
|
||||
if err := self.RatingDb.SetActionPlan(actionPlanID, ap, true); err != nil {
|
||||
return 0, err
|
||||
|
||||
@@ -1002,7 +1002,7 @@ func (ms *MapStorage) GetAllActionPlans() (ats map[string]*ActionPlan, err error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ats[key] = ap
|
||||
ats[key[len(utils.ACTION_PLAN_PREFIX):]] = ap
|
||||
}
|
||||
|
||||
return
|
||||
|
||||
@@ -1471,7 +1471,7 @@ func (ms *MongoStorage) GetAllActionPlans() (ats map[string]*ActionPlan, err err
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ats[key] = ap
|
||||
ats[key[len(utils.ACTION_PLAN_PREFIX):]] = ap
|
||||
}
|
||||
|
||||
return
|
||||
|
||||
@@ -1053,7 +1053,7 @@ func (rs *RedisStorage) GetAllActionPlans() (ats map[string]*ActionPlan, err err
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ats[key] = ap
|
||||
ats[key[len(utils.ACTION_PLAN_PREFIX):]] = ap
|
||||
}
|
||||
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user