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

Download changes

parent 3348c333
No related branches found
No related tags found
1 merge request!116Release v1.0.0
...@@ -48,9 +48,11 @@ module.exports = function download(table, mappingTable) { ...@@ -48,9 +48,11 @@ module.exports = function download(table, mappingTable) {
let dl = new Download({ let dl = new Download({
userId: req.user._id, userId: req.user._id,
table, table,
name: req.query.name,
mappingTable, mappingTable,
query: req.sql.toString() query: req.sql.toString()
}); });
console.log(dl);
dl.save((err) => { dl.save((err) => {
if(err) log.error(err); if(err) log.error(err);
}); });
...@@ -59,9 +61,11 @@ module.exports = function download(table, mappingTable) { ...@@ -59,9 +61,11 @@ module.exports = function download(table, mappingTable) {
download = new Download({ download = new Download({
userId: req.user._id, userId: req.user._id,
table, table,
name: req.query.name,
mappingTable, mappingTable,
query: req.sql.toString() query: req.sql.toString()
}); });
console.log(download);
} }
download.save((err) => { download.save((err) => {
......
...@@ -14,6 +14,10 @@ let Download = new Schema({ ...@@ -14,6 +14,10 @@ let Download = new Schema({
type: String, type: String,
required: true required: true
}, },
name: {
type: String,
required: true
},
mappingTable: { mappingTable: {
type: String, type: String,
required: true required: true
......
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