Commit 6849492ceaaa3c0422069c67ada1b3619bee5067

Authored by Eric Fernandez
1 parent 52b838b421
Exists in master

guardo primero pmae

Showing 1 changed file with 5 additions and 6 deletions   Show diff stats
rutas/comprobantes.js
... ... @@ -45,11 +45,9 @@ router.post('/comprobante', function(req, res) {
45 45 // var recadv = require('../recadv')(JSON.parse(JSON.stringify(req.body.cabecera)),
46 46 // JSON.parse(JSON.stringify(req.body.cuerpo)));
47 47  
48   - var guardar = wsServer.guardarComprobante(req.body, req.body.cabecera.GLN);
  48 + wsServer.guardarComprobante(req.body, req.body.cabecera.GLN).then(() => {
49 49  
50   - Promise.all([
51   - // recadv,
52   - guardar,
  50 + Promise.all([
53 51 knex('PMAEFACT_TEMP').where({
54 52 TIP: req.body.cabecera.TIP,
55 53 TCO: req.body.cabecera.TCO,
... ... @@ -71,8 +69,9 @@ router.post('/comprobante', function(req, res) {
71 69 })
72 70 .catch(err => {
73 71 console.log(err);
74   - console.log({data: 'error al guardar algo ruta comprobantes'});
75   - res.status(500).send(err)
  72 + res.status(500).send(err);
76 73 });
  74 + })
  75 + .catch((err) => res.status(500).send(err));
77 76  
78 77 });