Skip to content
Snippets Groups Projects
Commit 41623f85 authored by syuilo's avatar syuilo
Browse files

Fix bug

parent fd28d1bc
No related branches found
Tags 8.19.0
No related merge requests found
......@@ -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, {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment