Remove unnecesary things

This commit is contained in:
TeoV
2018-07-31 08:29:56 -04:00
committed by Dan Christian Bogos
parent 909358a124
commit da8cd6360e
3 changed files with 5 additions and 15 deletions

View File

@@ -402,25 +402,17 @@ func (spS *SupplierService) sortedSuppliersForEvent(args *ArgsGetSuppliers) (sor
if err != nil {
return nil, err
}
srtTmp := &SortedSuppliers{
ProfileID: sortedSuppliers.ProfileID,
Sorting: sortedSuppliers.Sorting,
}
for _, s := range sortedSuppliers.SortedSuppliers {
srtTmp.SortedSuppliers = append(srtTmp.SortedSuppliers, s)
}
if args.Paginator.Offset != nil {
if *args.Paginator.Offset <= len(srtTmp.SortedSuppliers) {
srtTmp.SortedSuppliers = srtTmp.SortedSuppliers[*args.Paginator.Offset:]
if *args.Paginator.Offset <= len(sortedSuppliers.SortedSuppliers) {
sortedSuppliers.SortedSuppliers = sortedSuppliers.SortedSuppliers[*args.Paginator.Offset:]
}
}
if args.Paginator.Limit != nil {
if *args.Paginator.Limit <= len(srtTmp.SortedSuppliers) {
srtTmp.SortedSuppliers = srtTmp.SortedSuppliers[:*args.Paginator.Limit]
if *args.Paginator.Limit <= len(sortedSuppliers.SortedSuppliers) {
sortedSuppliers.SortedSuppliers = sortedSuppliers.SortedSuppliers[:*args.Paginator.Limit]
}
}
return srtTmp, nil
return sortedSuppliers, nil
}
type ArgsGetSuppliers struct {

View File

@@ -1386,7 +1386,6 @@ type TPFilter struct {
type TPSupplier struct {
ID string // SupplierID
SortingFilter []string
FilterIDs []string
AccountIDs []string
RatingPlanIDs []string // used when computing price

View File

@@ -486,7 +486,6 @@ const (
MetaLeastCost = "*least_cost"
MetaHighestCost = "*highest_cost"
MetaQOS = "*qos"
MetaStatFiltered = "*stat_filtered"
Weight = "Weight"
Cost = "Cost"
RatingPlanID = "RatingPlanID"