diff --git a/handler.go b/handler.go index acc12b8..6ef928e 100644 --- a/handler.go +++ b/handler.go @@ -136,8 +136,11 @@ func (api *API) collectionGetHandler(m mgocrud.ModelInterface) gin.HandlerFunc { } clearedSort := []string{} for _, s := range sort { - if s != "" { - clearedSort = append(clearedSort, s) + // split by comma and append all parts to clearedSort + for _, sPart := range strings.Split(s, ",") { + if sPart != "" { + clearedSort = append(clearedSort, sPart) + } } }