Created
March 13, 2017 16:04
-
-
Save quagliato/5b81abd50da0172b7577489f9ed7ac0b to your computer and use it in GitHub Desktop.
google_groups-nodebr-rZ4RD0QbqNU
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const gravar = require('./gravar.js'); | |
function getBoleto () { | |
return axios.get( | |
'/boletos', | |
).then(res => { | |
return res.data; | |
}) | |
.catch(err => { | |
console.log('Erro ao obter os boletos', err); | |
}) | |
} | |
getBoleto().then(boletos => { | |
gravar(boletos, function(err) { | |
if (err) { | |
throw new Error('Boletos são salvos'); | |
} | |
console.log('Boletos salvos.'); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (object, callback) { | |
// Save no DB | |
callback(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment