Skip to content
Snippets Groups Projects
Commit 6e1e665d authored by Vytor Calixto's avatar Vytor Calixto :space_invader:
Browse files

Add download middleware to class route

parent a19d3689
No related branches found
No related tags found
1 merge request!116Release v1.0.0
Pipeline #
......@@ -348,42 +348,4 @@ classApp.get('/', rqfCount.parse(), rqfCount.build(), (req, res, next) => {
classApp.get('/download', passport.authenticate('bearer', { session: false }), rqfCount.parse(), rqfCount.build(), download('turma', 'mapping_turma'));
// classApp.get('/download', (req, res, next) => {
// // first, query the mapping
// req.sql.from('mapping_turma')
// .field('target_name')
// .field('name');
// next();
// }, query, (req, res, next) => {
// req.resetSql();
// next();
// }, rqfCount.parse(), rqfCount.build(), (req, res, next) => {
// let username = req.query.user;
// let email = req.query.email;
// req.sql.from('turma')
// .field('*');
// let header = '';
// req.result.forEach((result) => {
// if(header === '') header += result.name;
// else header = header + ';' + result.name;
// });
// let form = {
// query: req.sql.toString(),
// table: req.sql.tableFrom,
// name: req.sql.tableFrom,
// username,
// email,
// header
// };
// request.post(config.cdn.url + '/api/v1/file', {form}, (err, response, body) => {
// if(err) {
// log.error(err);
// return res.json({error: err});
// }
// res.json({msg: 'Wait for download email'});
// });
// });
module.exports = classApp;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment