mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-21 07:08:45 +05:00
Uniformize the logic for model_helpers for TPRoutes
This commit is contained in:
committed by
Dan Christian Bogos
parent
2a61854311
commit
c8a9b18428
@@ -1933,14 +1933,12 @@ func (tps TPRoutes) AsTPRouteProfile() (result []*utils.TPRouteProfile) {
|
||||
sup, found := routeMap[tenID][routeID]
|
||||
if !found {
|
||||
sup = &utils.TPRoute{
|
||||
ID: tp.RouteID,
|
||||
Weight: tp.RouteWeight,
|
||||
Blocker: tp.RouteBlocker,
|
||||
ID: tp.RouteID,
|
||||
Weight: tp.RouteWeight,
|
||||
Blocker: tp.RouteBlocker,
|
||||
RouteParameters: tp.RouteParameters,
|
||||
}
|
||||
}
|
||||
if tp.RouteParameters != utils.EmptyString {
|
||||
sup.RouteParameters = tp.RouteParameters
|
||||
}
|
||||
if tp.RouteFilterIDs != utils.EmptyString {
|
||||
supFilterSplit := strings.Split(tp.RouteFilterIDs, utils.INFIELD_SEP)
|
||||
sup.FilterIDs = append(sup.FilterIDs, supFilterSplit...)
|
||||
@@ -1978,7 +1976,7 @@ func (tps TPRoutes) AsTPRouteProfile() (result []*utils.TPRouteProfile) {
|
||||
if tp.Weight != 0 {
|
||||
th.Weight = tp.Weight
|
||||
}
|
||||
if len(tp.ActivationInterval) != 0 {
|
||||
if tp.ActivationInterval != utils.EmptyString {
|
||||
th.ActivationInterval = new(utils.TPActivationInterval)
|
||||
aiSplt := strings.Split(tp.ActivationInterval, utils.INFIELD_SEP)
|
||||
if len(aiSplt) == 2 {
|
||||
|
||||
Reference in New Issue
Block a user