Added limit
This commit is contained in:
parent
218f5de6a0
commit
219c2f449c
1 changed files with 4 additions and 0 deletions
|
@ -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: {
|
||||
|
|
Loading…
Reference in a new issue