diff options
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/endpoints/posts.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/api/endpoints/posts.ts b/src/api/endpoints/posts.ts index 3b29425927..7df744d2a3 100644 --- a/src/api/endpoints/posts.ts +++ b/src/api/endpoints/posts.ts @@ -27,6 +27,10 @@ module.exports = (params) => new Promise(async (res, rej) => { const [poll, pollErr] = $(params.poll).optional.boolean().$; if (pollErr) return rej('invalid poll param'); + // Get 'bot' parameter + //const [bot, botErr] = $(params.bot).optional.boolean().$; + //if (botErr) return rej('invalid bot param'); + // Get 'limit' parameter const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$; if (limitErr) return rej('invalid limit param'); @@ -76,6 +80,11 @@ module.exports = (params) => new Promise(async (res, rej) => { query.poll = poll ? { $exists: true, $ne: null } : null; } + // TODO + //if (bot != undefined) { + // query.is_bot = bot; + //} + // Issue query const posts = await Post .find(query, { |