mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
updated RemTpData to check args map in switch case
This commit is contained in:
committed by
Dan Christian Bogos
parent
b9fcf8b24e
commit
9dfd36e7f2
@@ -558,8 +558,23 @@ func (iDB *InternalDB) RemTpData(table, tpid string, args map[string]string) (er
|
||||
}
|
||||
key := tpid
|
||||
if args != nil {
|
||||
for _, val := range args {
|
||||
key += utils.CONCATENATED_KEY_SEP + val
|
||||
switch table {
|
||||
case utils.TBLTPAccountActions:
|
||||
key += utils.CONCATENATED_KEY_SEP + args["loadid"] +
|
||||
utils.CONCATENATED_KEY_SEP + args["tenant"] +
|
||||
utils.CONCATENATED_KEY_SEP + args["account"]
|
||||
case utils.TBLTPRateProfiles:
|
||||
key += utils.CONCATENATED_KEY_SEP + args["loadid"] +
|
||||
utils.CONCATENATED_KEY_SEP + args["tenant"] +
|
||||
utils.CONCATENATED_KEY_SEP + args["category"] +
|
||||
utils.CONCATENATED_KEY_SEP + args["subject"]
|
||||
default:
|
||||
if tag, has := args["tag"]; has {
|
||||
key += utils.CONCATENATED_KEY_SEP + tag
|
||||
} else if id, has := args["id"]; has {
|
||||
key += utils.CONCATENATED_KEY_SEP + args["tenant"] +
|
||||
utils.CONCATENATED_KEY_SEP + id
|
||||
}
|
||||
}
|
||||
}
|
||||
ids := iDB.db.GetItemIDs(table, key)
|
||||
|
||||
Reference in New Issue
Block a user