This commit is contained in:
syuilo 2017-12-21 15:37:26 +09:00
parent fd28d1bcc3
commit 41623f8590

View File

@ -85,7 +85,7 @@ module.exports = (params, me) => new Promise(async (res, rej) => {
// Search by MongoDB
async function byNative(res, rej, me, text, userId, following, reply, repost, media, poll, sinceDate, untilDate, offset, max) {
const q: any = {
let q: any = {
$and: []
};
@ -216,6 +216,10 @@ async function byNative(res, rej, me, text, userId, following, reply, repost, me
});
}
if (q.$and.length == 0) {
q = {};
}
// Search posts
const posts = await Post
.find(q, {