mirror of
https://github.com/hotomoe/hotomoe
synced 2024-12-03 09:18:09 +09:00
wip
This commit is contained in:
parent
ffac713181
commit
9d3dff8805
@ -31,12 +31,12 @@ module.exports = (params, user) =>
|
||||
if (offsetErr) return rej('invalid offset');
|
||||
|
||||
// Get 'sort' parameter
|
||||
const [sort] = it(params.sort).expect.string().or('desc asc').default('desc').qed();
|
||||
let sort = params.sort || 'desc';
|
||||
const [sort, sortError] = it(params.sort).expect.string().or('desc asc').default('desc').qed();
|
||||
if (sortError) return rej('invalid sort');
|
||||
|
||||
// Lookup post
|
||||
const post = await Post.findOne({
|
||||
_id: new mongo.ObjectID(postId)
|
||||
_id: postId
|
||||
});
|
||||
|
||||
if (post === null) {
|
||||
|
Loading…
Reference in New Issue
Block a user