mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-24 08:38:45 +05:00
Fixed the reference removing for filters in rates
This commit is contained in:
committed by
Dan Christian Bogos
parent
81217a7088
commit
94516cba69
@@ -2062,10 +2062,15 @@ func (dm *DataManager) RemoveRateProfileRates(ctx *context.Context, tenant, id s
|
||||
continue
|
||||
}
|
||||
if withIndex {
|
||||
|
||||
if err = removeItemFromFilterIndex(ctx, dm, utils.CacheRateFilterIndexes,
|
||||
tenant, id, rateID, oldRpp.Rates[rateID].FilterIDs); err != nil {
|
||||
return
|
||||
for key, rate := range oldRpp.Rates {
|
||||
if err = removeIndexFiltersItem(ctx, dm, utils.CacheRateFilterIndexes,
|
||||
tenant, utils.ConcatenatedKey(key, oldRpp.ID), rate.FilterIDs); err != nil {
|
||||
return
|
||||
}
|
||||
if err = removeItemFromFilterIndex(ctx, dm, utils.CacheRateFilterIndexes,
|
||||
tenant, id, rateID, rate.FilterIDs); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
delete(oldRpp.Rates, rateID)
|
||||
|
||||
Reference in New Issue
Block a user