良い感じに
This commit is contained in:
@ -81,6 +81,7 @@ export default [
|
||||
{ name: 'following/create', shouldBeSignin: true, limitDuration: hour, limitMax: 100, kind: 'following-write' },
|
||||
{ name: 'following/delete', shouldBeSignin: true, limitDuration: hour, limitMax: 100, kind: 'following-write' },
|
||||
|
||||
{ name: 'posts', shouldBeSignin: false },
|
||||
{ name: 'posts/show', shouldBeSignin: false },
|
||||
{ name: 'posts/replies', shouldBeSignin: false },
|
||||
{ name: 'posts/context', shouldBeSignin: false },
|
||||
|
@ -15,6 +15,22 @@ import serialize from '../serializers/post';
|
||||
module.exports = (params) =>
|
||||
new Promise(async (res, rej) =>
|
||||
{
|
||||
// Get 'include_replies' parameter
|
||||
let includeReplies = params.include_replies;
|
||||
if (includeReplies === true) {
|
||||
includeReplies = true;
|
||||
} else {
|
||||
includeReplies = false;
|
||||
}
|
||||
|
||||
// Get 'include_reposts' parameter
|
||||
let includeReposts = params.include_reposts;
|
||||
if (includeReposts === true) {
|
||||
includeReposts = true;
|
||||
} else {
|
||||
includeReposts = false;
|
||||
}
|
||||
|
||||
// Get 'limit' parameter
|
||||
let limit = params.limit;
|
||||
if (limit !== undefined && limit !== null) {
|
||||
@ -52,6 +68,14 @@ module.exports = (params) =>
|
||||
};
|
||||
}
|
||||
|
||||
if (!includeReplies) {
|
||||
query.reply_to_id = null;
|
||||
}
|
||||
|
||||
if (!includeReposts) {
|
||||
query.repost_id = null;
|
||||
}
|
||||
|
||||
// Issue query
|
||||
const posts = await Post
|
||||
.find(query, {
|
||||
|
Reference in New Issue
Block a user