We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a20257b commit 19fe260Copy full SHA for 19fe260
1 file changed
api/utils.ts
@@ -1,4 +1,5 @@
1
import { VercelRequest, VercelResponse } from '@vercel/node'
2
+import process from 'process'
3
import { Collection, Db, MongoClient } from 'mongodb'
4
import { HandleRouter, Route, getProjectSrotFromStr } from 'serverless-kit'
5
@@ -28,7 +29,7 @@ Route.prototype.parseLimits = function () {
28
29
return this.check((ctx) => {
30
ctx.offset = parseInt((ctx.req.query.offset as string) || '0')
31
ctx.limit = Math.min(25, parseInt((ctx.req.query.limit as string) || '10'))
- ctx.sort = getProjectSrotFromStr((ctx.req.query.sort as string) || '')
32
+ ctx.sort = getProjectSrotFromStr((ctx.req.query.sort as string) || '!_id')
33
34
ctx.project = null
35
ctx.req.query.project = ctx.req.query.project || ctx.req.query.prop || ''
0 commit comments