This commit is contained in:
Andris Reinman 2020-11-18 18:19:56 +02:00
parent 5d3f99492f
commit b26d97bc13
4 changed files with 5 additions and 3 deletions

View file

@ -284,6 +284,7 @@ paths:
- name: query - name: query
in: query in: query
description: Prefix of an address or a name description: Prefix of an address or a name
required: true
schema: schema:
type: string type: string
- name: limit - name: limit

View file

@ -1083,7 +1083,7 @@ module.exports = (db, server, userHandler) => {
const schema = Joi.object().keys({ const schema = Joi.object().keys({
user: Joi.string().hex().lowercase().length(24).required(), user: Joi.string().hex().lowercase().length(24).required(),
query: Joi.string().trim().empty('').max(255), query: Joi.string().trim().empty('').max(255).required(),
limit: Joi.number().default(20).min(1).max(250), limit: Joi.number().default(20).min(1).max(250),
sess: sessSchema, sess: sessSchema,
ip: sessIPSchema ip: sessIPSchema

View file

@ -164,7 +164,8 @@ class MessageHandler {
address: addr.address, address: addr.address,
addrview: addr.addrview addrview: addr.addrview
} }
} },
{ upsert: true, projection: { _id: true } }
); );
} }
} catch (err) { } catch (err) {

View file

@ -1,6 +1,6 @@
{ {
"name": "wildduck", "name": "wildduck",
"version": "1.31.0", "version": "1.31.1",
"description": "IMAP/POP3 server built with Node.js and MongoDB", "description": "IMAP/POP3 server built with Node.js and MongoDB",
"main": "server.js", "main": "server.js",
"scripts": { "scripts": {