mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-11-10 00:11:34 +08:00
Add id query to threads route
This commit is contained in:
parent
621f8b5c2b
commit
ab4c8cf32c
1 changed files with 4 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ module.exports = (server) => {
|
|||
query: {
|
||||
unread: Joi.boolean(),
|
||||
starred: Joi.boolean(),
|
||||
id: Joi.number().integer().min(0),
|
||||
},
|
||||
},
|
||||
response: {
|
||||
|
|
@ -26,6 +27,9 @@ module.exports = (server) => {
|
|||
const {Thread} = db;
|
||||
const where = {};
|
||||
|
||||
if (request.query.id) {
|
||||
where.id = request.query.id;
|
||||
}
|
||||
if (request.query.unread) {
|
||||
where.unreadCount = {gt: 0};
|
||||
} else if (request.query.unread !== undefined) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue