wip
This commit is contained in:
@@ -12,9 +12,9 @@ import Post, { pack } from '../../models/post';
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
||||
// Get 'post_id' parameter
|
||||
const [postId, postIdErr] = $(params.post_id).id().$;
|
||||
if (postIdErr) return rej('invalid post_id param');
|
||||
// Get 'postId' parameter
|
||||
const [postId, postIdErr] = $(params.postId).id().$;
|
||||
if (postIdErr) return rej('invalid postId param');
|
||||
|
||||
// Get 'limit' parameter
|
||||
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
|
||||
@@ -48,13 +48,13 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (p.reply_id) {
|
||||
await get(p.reply_id);
|
||||
if (p.replyId) {
|
||||
await get(p.replyId);
|
||||
}
|
||||
}
|
||||
|
||||
if (post.reply_id) {
|
||||
await get(post.reply_id);
|
||||
if (post.replyId) {
|
||||
await get(post.replyId);
|
||||
}
|
||||
|
||||
// Serialize
|
||||
|
Reference in New Issue
Block a user