UNPKG

bookshelf-rest-api

Version:

Quickly build a rest API with little to no thought if you're using Bookshelf.js for your models

10 lines (9 loc) 209 B
module.exports = function(req) { var order = req.query.order || "DESC"; var sort = req.query.sort; return function(qb) { if(sort) { qb.orderBy(sort, order); } }; };