aboutsummaryrefslogblamecommitdiffhomepage
path: root/server/middlewares/sort.js
blob: 9f52290a6446a1f85dae27da13374082e9963c0f (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                                                              
'use strict'

const sortMiddleware = {
  setVideosSort: setVideosSort
}

function setVideosSort (req, res, next) {
  if (!req.query.sort) req.query.sort = '-createdDate'

  return next()
}

// ---------------------------------------------------------------------------

module.exports = sortMiddleware