]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/sort.ts
Move config in its own file
[github/Chocobozzz/PeerTube.git] / server / middlewares / sort.ts
index 8a62c8be65a8d5e5c78c16a72ecaab69097cdfd3..6507aa5b8b54a7396cb0d59dc149757f26d7ae62 100644 (file)
@@ -1,6 +1,6 @@
 import * as express from 'express'
 import 'express-validator'
-import { SortType } from '../helpers/utils'
+import { SortType } from '../models/utils'
 
 function setDefaultSort (req: express.Request, res: express.Response, next: express.NextFunction) {
   if (!req.query.sort) req.query.sort = '-createdAt'
@@ -15,7 +15,7 @@ function setDefaultSearchSort (req: express.Request, res: express.Response, next
 }
 
 function setBlacklistSort (req: express.Request, res: express.Response, next: express.NextFunction) {
-  let newSort: SortType = { sortModel: undefined, sortValue: undefined }
+  let newSort: SortType = { sortModel: undefined, sortValue: '' }
 
   if (!req.query.sort) req.query.sort = '-createdAt'