Added limit

This commit is contained in:
dbroqua 2019-03-15 13:56:56 +01:00
parent 218f5de6a0
commit 219c2f449c

View File

@ -138,6 +138,10 @@ class Vegetables {
}
static searchAll (req, callback) {
if (!req.query.q || req.query.q.length < 3) {
callback(new Error('Minimum 3 letters'), 406)
return false
}
vegetables.findAndCountAll({
where: {
name: {