Commit 3217de4bba4d37b078a82ac4407a50851746d506
Exists in
master
and in
2 other branches
Merge branch 'master' into 'master'
Master(efernandez) See merge request !4
Showing
1 changed file
Show diff stats
rutas/articulos.js
... | ... | @@ -13,14 +13,16 @@ const Articulo = bookshelf.Model.extend({ |
13 | 13 | } |
14 | 14 | }); |
15 | 15 | |
16 | -router.get('/articulos/:page', (req, res) => { | |
16 | +router.post('/articulos', (req, res) => { | |
17 | 17 | |
18 | 18 | Articulo |
19 | - .query(() => {}) | |
19 | + .query((qb) => { | |
20 | + qb.where(`DET_LAR`, `like`, `%${req.body.search}%`); | |
21 | + }) | |
20 | 22 | .orderBy('id') |
21 | 23 | .fetchPage({ |
22 | 24 | pageSize: 150, |
23 | - page: req.params.page, | |
25 | + page: req.body.page, | |
24 | 26 | withRelated: ['imagenes'] |
25 | 27 | }) |
26 | 28 | .then(data => { |