Showing
2 changed files
with
28 additions
and
2 deletions
... | @@ -53,8 +53,8 @@ router.get('/show', function(req, res, next) { | ... | @@ -53,8 +53,8 @@ router.get('/show', function(req, res, next) { |
53 | console.log('select2 error'); | 53 | console.log('select2 error'); |
54 | res.status(400).send({ err: err }); | 54 | res.status(400).send({ err: err }); |
55 | } else { | 55 | } else { |
56 | - let gerFile = 'SELECT * FROM files WHERE location = ? AND user_id = ?;'; | 56 | + let gerFile = 'SELECT * FROM files WHERE location = ? AND user_id = ? AND folder_name != ?;'; |
57 | - connection.query(gerFile, [location, user_id], function(err, file) { | 57 | + connection.query(gerFile, [location, user_id, 'trashcan'], function(err, file) { |
58 | if (err) { | 58 | if (err) { |
59 | console.log('select3 error'); | 59 | console.log('select3 error'); |
60 | res.status(400).send({ err: err }); | 60 | res.status(400).send({ err: err }); | ... | ... |
... | @@ -7,6 +7,32 @@ var S3 = require(__dirname + '/modules/s3/s3'); | ... | @@ -7,6 +7,32 @@ var S3 = require(__dirname + '/modules/s3/s3'); |
7 | 7 | ||
8 | const s3 = new AWS.S3(); | 8 | const s3 = new AWS.S3(); |
9 | 9 | ||
10 | +router.get('/show', function(req, res, next) { | ||
11 | + console.log(req.query); | ||
12 | + user_id = req.query.id; | ||
13 | + | ||
14 | + let checkfolder = 'SELECT * FROM folders WHERE location = ? AND user_id = ?;'; | ||
15 | + connection.query(checkfolder, ['/trashcan/', user_id], function(err, folder) { | ||
16 | + if (err) { | ||
17 | + console.log('select error'); | ||
18 | + res.status(400).send({ err: err }); | ||
19 | + } else { | ||
20 | + let checkfile = 'SELECT * FROM files WHERE location = ? AND user_id = ?;'; | ||
21 | + connection.query(checkfile, ['/trashcan/', user_id], function(err, file) { | ||
22 | + if (err) { | ||
23 | + console.log('select error'); | ||
24 | + res.status(400).send({ err: err }); | ||
25 | + } else { | ||
26 | + res.status(200).send({ | ||
27 | + folders: folder, | ||
28 | + files: file | ||
29 | + }) | ||
30 | + } | ||
31 | + }); | ||
32 | + } | ||
33 | + }); | ||
34 | +}); | ||
35 | + | ||
10 | router.get('/delfile', function(req, res, next) { | 36 | router.get('/delfile', function(req, res, next) { |
11 | var file_id = req.query.file_id; | 37 | var file_id = req.query.file_id; |
12 | var user_id = req.query.id; | 38 | var user_id = req.query.id; | ... | ... |
-
Please register or login to post a comment