mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-11-10 16:31:44 +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: {
|
query: {
|
||||||
unread: Joi.boolean(),
|
unread: Joi.boolean(),
|
||||||
starred: Joi.boolean(),
|
starred: Joi.boolean(),
|
||||||
|
id: Joi.number().integer().min(0),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
response: {
|
response: {
|
||||||
|
|
@ -26,6 +27,9 @@ module.exports = (server) => {
|
||||||
const {Thread} = db;
|
const {Thread} = db;
|
||||||
const where = {};
|
const where = {};
|
||||||
|
|
||||||
|
if (request.query.id) {
|
||||||
|
where.id = request.query.id;
|
||||||
|
}
|
||||||
if (request.query.unread) {
|
if (request.query.unread) {
|
||||||
where.unreadCount = {gt: 0};
|
where.unreadCount = {gt: 0};
|
||||||
} else if (request.query.unread !== undefined) {
|
} else if (request.query.unread !== undefined) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue