mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-22 08:16:09 +08:00
Add subject query to threads route
This commit is contained in:
parent
2e56d3ced4
commit
5077b3f027
|
@ -12,6 +12,7 @@ module.exports = (server) => {
|
||||||
validate: {
|
validate: {
|
||||||
query: {
|
query: {
|
||||||
id: Joi.number().integer().min(0),
|
id: Joi.number().integer().min(0),
|
||||||
|
subject: Joi.string(),
|
||||||
unread: Joi.boolean(),
|
unread: Joi.boolean(),
|
||||||
starred: Joi.boolean(),
|
starred: Joi.boolean(),
|
||||||
startedBefore: Joi.date().timestamp(),
|
startedBefore: Joi.date().timestamp(),
|
||||||
|
@ -35,6 +36,11 @@ module.exports = (server) => {
|
||||||
if (query.id) {
|
if (query.id) {
|
||||||
where.id = query.id;
|
where.id = query.id;
|
||||||
}
|
}
|
||||||
|
if (query.subject) {
|
||||||
|
// the 'like' operator is case-insenstive in sequelite and for
|
||||||
|
// non-binary strings in mysql
|
||||||
|
where.subject = {like: query.subject};
|
||||||
|
}
|
||||||
|
|
||||||
// Boolean queries
|
// Boolean queries
|
||||||
if (query.unread) {
|
if (query.unread) {
|
||||||
|
|
Loading…
Reference in a new issue