Improved Search

This commit is contained in:
dbroqua 2019-04-12 13:20:17 +02:00
parent c121746380
commit 53cebca836

View file

@ -160,11 +160,16 @@ class Vegetables {
}
vegetables.findAndCountAll({
where: {
name: {
[Op.like]: `%${req.query.q}%`
[Op.or]: {
name: {
[Op.like]: `%${req.query.q}%`
},
'$Properties.value$': {
[Op.like]: `%${req.query.q}%`
}
}
},
include: ['Type'],
include: ['Type', 'Properties'],
order: [
['name', 'ASC']
]