mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-23 20:49:06 +01:00
wip
This commit is contained in:
parent
07392f9ca4
commit
894324bf3c
@ -31,12 +31,12 @@ module.exports = (params, user) =>
|
|||||||
if (offsetErr) return rej('invalid offset');
|
if (offsetErr) return rej('invalid offset');
|
||||||
|
|
||||||
// Get 'sort' parameter
|
// Get 'sort' parameter
|
||||||
const [sort] = it(params.sort).expect.string().or('desc asc').default('desc').qed();
|
const [sort, sortError] = it(params.sort).expect.string().or('desc asc').default('desc').qed();
|
||||||
let sort = params.sort || 'desc';
|
if (sortError) return rej('invalid sort');
|
||||||
|
|
||||||
// Lookup post
|
// Lookup post
|
||||||
const post = await Post.findOne({
|
const post = await Post.findOne({
|
||||||
_id: new mongo.ObjectID(postId)
|
_id: postId
|
||||||
});
|
});
|
||||||
|
|
||||||
if (post === null) {
|
if (post === null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user