Showing
1 changed file
with
3 additions
and
1 deletions
... | @@ -102,9 +102,10 @@ router.post('/addfile', function(req, res, next) { | ... | @@ -102,9 +102,10 @@ router.post('/addfile', function(req, res, next) { |
102 | router.post('/delfolder', function(req, res, next) { | 102 | router.post('/delfolder', function(req, res, next) { |
103 | let user_id = req.body.id; | 103 | let user_id = req.body.id; |
104 | let folder_name = req.body.name; | 104 | let folder_name = req.body.name; |
105 | + let cur = req.body.cur; | ||
105 | let checkfolder = 'SELECT * FROM folders WHERE location = ? AND user_id = ? AND folder_name = ? AND favorite = 1;'; | 106 | let checkfolder = 'SELECT * FROM folders WHERE location = ? AND user_id = ? AND folder_name = ? AND favorite = 1;'; |
106 | 107 | ||
107 | - connection.query(checkfolder, [user_id, folder_name], function(err, rows, fields) { | 108 | + connection.query(checkfolder, [cur, user_id, folder_name], function(err, rows, fields) { |
108 | if (err) { | 109 | if (err) { |
109 | console.log('select error'); | 110 | console.log('select error'); |
110 | res.status(400).send({ error: err }); | 111 | res.status(400).send({ error: err }); |
... | @@ -135,6 +136,7 @@ router.post('/delfolder', function(req, res, next) { | ... | @@ -135,6 +136,7 @@ router.post('/delfolder', function(req, res, next) { |
135 | router.post('/delfile', function(req, res, next) { | 136 | router.post('/delfile', function(req, res, next) { |
136 | let user_id = req.body.id; | 137 | let user_id = req.body.id; |
137 | let file_name = req.body.name; | 138 | let file_name = req.body.name; |
139 | + let cur = req.body.cur; | ||
138 | 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;'; |
139 | 141 | ||
140 | connection.query(checkfile, [user_id, file_name], function(err, rows, fields) { | 142 | connection.query(checkfile, [user_id, file_name], function(err, rows, fields) { | ... | ... |
-
Please register or login to post a comment