Hong

파일이동즐겨찾기

...@@ -139,7 +139,7 @@ router.post('/delfile', function(req, res, next) { ...@@ -139,7 +139,7 @@ router.post('/delfile', function(req, res, next) {
139 let cur = req.body.cur; 139 let cur = req.body.cur;
140 let checkfile = 'SELECT * FROM files WHERE location = ? AND user_id = ? AND file_name = ? AND favorite = 1;'; 140 let checkfile = 'SELECT * FROM files WHERE location = ? AND user_id = ? AND file_name = ? AND favorite = 1;';
141 141
142 - connection.query(checkfile, [cur,user_id, file_name], function(err, rows, fields) { 142 + connection.query(checkfile, [cur, user_id, file_name], function(err, rows, fields) {
143 if (err) { 143 if (err) {
144 console.log('select error'); 144 console.log('select error');
145 res.status(400).send({ error: err }); 145 res.status(400).send({ error: err });
...@@ -151,8 +151,8 @@ router.post('/delfile', function(req, res, next) { ...@@ -151,8 +151,8 @@ router.post('/delfile', function(req, res, next) {
151 console.log('update error'); 151 console.log('update error');
152 res.status(400).send({ error: err }); 152 res.status(400).send({ error: err });
153 } else { 153 } else {
154 - let getfolder = 'SELECT * FROM files WHERE location = ? AND user_id = ?;'; 154 + let getfile = 'SELECT * FROM files WHERE location = ? AND user_id = ?;';
155 - connection.query(getfolder, [cur, user_id], function(err, files, fields) { 155 + connection.query(getfile, [cur, user_id], function(err, files, fields) {
156 res.status(200).send({ 156 res.status(200).send({
157 files: files 157 files: files
158 }) 158 })
......
...@@ -154,7 +154,7 @@ router.post('/move', function(req, res, next) { ...@@ -154,7 +154,7 @@ router.post('/move', function(req, res, next) {
154 curPath = user_id + cur; 154 curPath = user_id + cur;
155 let name = req.body.name; 155 let name = req.body.name;
156 let newPath = user_id + req.body.newPath; 156 let newPath = user_id + req.body.newPath;
157 - if (req.body.isfolder == 'true') { 157 + if (req.body.isfolder) {
158 let checkfolder = 'SELECT * FROM folders WHERE location = ? AND folder_name = ? AND user_id = ?;'; 158 let checkfolder = 'SELECT * FROM folders WHERE location = ? AND folder_name = ? AND user_id = ?;';
159 connection.query(checkfolder, [cur, name, user_id], function(err1, rows, fields) { 159 connection.query(checkfolder, [cur, name, user_id], function(err1, rows, fields) {
160 console.log(rows); 160 console.log(rows);
......
...@@ -430,7 +430,7 @@ export default { ...@@ -430,7 +430,7 @@ export default {
430 const cData = { 430 const cData = {
431 id: this.$store.state.id, 431 id: this.$store.state.id,
432 cur: this.$store.state.cur, 432 cur: this.$store.state.cur,
433 - folder_name: this.curfName.folder_name, 433 + name: this.curfName.folder_name,
434 isfolder: true, 434 isfolder: true,
435 newPath: this.$store.state.cur + folderName + '/', 435 newPath: this.$store.state.cur + folderName + '/',
436 }; 436 };
......