ApierV1.LoadTariffPlanFromFolder fix for shared groups load

This commit is contained in:
DanB
2015-03-14 10:34:48 +01:00
parent 3d4ffd9dd9
commit 50252c3efc
2 changed files with 14 additions and 6 deletions

View File

@@ -1050,13 +1050,13 @@ func (csvr *CSVReader) LoadAll() error {
func (csvr *CSVReader) GetLoadedIds(categ string) ([]string, error) {
switch categ {
case DESTINATION_PREFIX:
ids := make([]string, len(csvr.destinations))
keys := make([]string, len(csvr.destinations))
i := 0
for k := range csvr.destinations {
ids[i] = k
keys[i] = k
i++
}
return ids, nil
return keys, nil
case RATING_PLAN_PREFIX:
keys := make([]string, len(csvr.ratingPlans))
i := 0
@@ -1121,6 +1121,14 @@ func (csvr *CSVReader) GetLoadedIds(categ string) ([]string, error) {
i++
}
return keys, nil
case SHARED_GROUP_PREFIX:
keys := make([]string, len(csvr.sharedGroups))
i := 0
for k := range csvr.sharedGroups {
keys[i] = k
i++
}
return keys, nil
}
return nil, errors.New("Unsupported category")
}