mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-22 15:48:44 +05:00
Added any_context option for AttributeS
This commit is contained in:
committed by
Dan Christian Bogos
parent
c28ac62968
commit
ccdeea7b9b
@@ -73,11 +73,14 @@ func (alS *AttributeService) attributeProfileForEvent(apiCtx *context.Context, t
|
||||
alS.cgrcfg.AttributeSCfg().IndexedSelects,
|
||||
alS.cgrcfg.AttributeSCfg().NestedFields,
|
||||
)
|
||||
if err != nil {
|
||||
if err != utils.ErrNotFound {
|
||||
return nil, err
|
||||
}
|
||||
if aPrflIDs, err = MatchingItemIDsForEvent(apiCtx, evNm,
|
||||
if err != nil &&
|
||||
err != utils.ErrNotFound {
|
||||
return nil, err
|
||||
}
|
||||
if err == utils.ErrNotFound ||
|
||||
alS.cgrcfg.AttributeSCfg().AnyContext {
|
||||
var aPrflAnyIDs utils.StringSet
|
||||
if aPrflAnyIDs, err = MatchingItemIDsForEvent(evNm,
|
||||
alS.cgrcfg.AttributeSCfg().StringIndexedFields,
|
||||
alS.cgrcfg.AttributeSCfg().PrefixIndexedFields,
|
||||
alS.cgrcfg.AttributeSCfg().SuffixIndexedFields,
|
||||
@@ -87,6 +90,11 @@ func (alS *AttributeService) attributeProfileForEvent(apiCtx *context.Context, t
|
||||
alS.cgrcfg.AttributeSCfg().NestedFields); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if aPrflIDs.Size() == 0 {
|
||||
aPrflIDs = aPrflAnyIDs
|
||||
} else {
|
||||
aPrflIDs = utils.JoinStringSet(aPrflIDs, aPrflAnyIDs)
|
||||
}
|
||||
}
|
||||
attrIDs = aPrflIDs.AsSlice()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user