Fix bug
This commit is contained in:
parent
fd28d1bcc3
commit
41623f8590
1 changed files with 5 additions and 1 deletions
|
@ -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, {
|
||||
|
|
Loading…
Reference in a new issue