Fix bug
This commit is contained in:
@ -78,11 +78,10 @@ module.exports = (params, me) =>
|
||||
|
||||
// Get followers
|
||||
const following = await Following
|
||||
.find(query, {}, {
|
||||
.find(query, {
|
||||
limit: limit + 1,
|
||||
sort: { _id: -1 }
|
||||
})
|
||||
.toArray();
|
||||
});
|
||||
|
||||
// 「次のページ」があるかどうか
|
||||
const inStock = following.length === limit + 1;
|
||||
|
@ -78,11 +78,10 @@ module.exports = (params, me) =>
|
||||
|
||||
// Get followers
|
||||
const following = await Following
|
||||
.find(query, {}, {
|
||||
.find(query, {
|
||||
limit: limit + 1,
|
||||
sort: { _id: -1 }
|
||||
})
|
||||
.toArray();
|
||||
});
|
||||
|
||||
// 「次のページ」があるかどうか
|
||||
const inStock = following.length === limit + 1;
|
||||
|
@ -111,11 +111,10 @@ module.exports = (params, me) =>
|
||||
|
||||
// Issue query
|
||||
const posts = await Post
|
||||
.find(query, {}, {
|
||||
.find(query, {
|
||||
limit: limit,
|
||||
sort: sort
|
||||
})
|
||||
.toArray();
|
||||
});
|
||||
|
||||
// Serialize
|
||||
res(await Promise.all(posts.map(async (post) =>
|
||||
|
@ -46,14 +46,13 @@ module.exports = (params, me) =>
|
||||
_id: {
|
||||
$nin: followingIds
|
||||
}
|
||||
}, {}, {
|
||||
}, {
|
||||
limit: limit,
|
||||
skip: offset,
|
||||
sort: {
|
||||
followers_count: -1
|
||||
}
|
||||
})
|
||||
.toArray();
|
||||
});
|
||||
|
||||
// Serialize
|
||||
res(await Promise.all(users.map(async user =>
|
||||
|
@ -63,8 +63,7 @@ async function byNative(res, rej, me, query, offset, max) {
|
||||
}, {
|
||||
name: new RegExp(escapedQuery)
|
||||
}]
|
||||
})
|
||||
.toArray();
|
||||
});
|
||||
|
||||
// Serialize
|
||||
res(await Promise.all(users.map(async user =>
|
||||
@ -106,8 +105,7 @@ async function byElasticsearch(res, rej, me, query, offset, max) {
|
||||
_id: {
|
||||
$in: hits
|
||||
}
|
||||
})
|
||||
.toArray();
|
||||
});
|
||||
|
||||
// Serialize
|
||||
res(await Promise.all(users.map(async user =>
|
||||
|
@ -56,8 +56,7 @@ module.exports = (params, me) =>
|
||||
}, {
|
||||
limit: limit,
|
||||
skip: offset
|
||||
})
|
||||
.toArray();
|
||||
});
|
||||
|
||||
// Serialize
|
||||
res(await Promise.all(users.map(async user =>
|
||||
|
Reference in New Issue
Block a user