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

@ -14,3 +14,11 @@ type Sort struct {
Field string `json:"field"`
Direction string `json:"direction"`
}
// TableName overrides the table name used by gorm
func (p *PageInfo) GetSort(def Sort) []Sort {
if p.Sort == nil {
return []Sort{def}
}
return p.Sort
}