Fix schema responses not matching tests

This commit is contained in:
Jamie Curnow
2023-05-29 14:19:17 +10:00
parent 4b39ef0eba
commit c849938da2
14 changed files with 28 additions and 13 deletions

View File

@ -4,6 +4,7 @@ import (
"fmt"
"strings"
"npm/internal/logger"
"npm/internal/model"
"gorm.io/gorm"
@ -36,6 +37,8 @@ func ScopeOrderBy(pageInfo *model.PageInfo, defaultSort model.Sort) func(db *gor
}
func ScopeFilters(filters []model.Filter, filterMap map[string]filterMapValue) func(db *gorm.DB) *gorm.DB {
logger.Debug("FILTERS: %+v", filters)
logger.Debug("FILTERMAP: %+v", filterMap)
return func(db *gorm.DB) *gorm.DB {
for _, f := range filters {
// Lookup this filter field from the name map