Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-CloudComputing
/
D_Team_Khuloud
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Hong
2020-06-10 20:23:19 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
baca0a1916de527e196f5c3f4ae48bbe815456c8
baca0a19
1 parent
8e3f0574
.
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
2 deletions
backend/routes/folders.js
backend/routes/trashcan.js
backend/routes/folders.js
View file @
baca0a1
...
...
@@ -53,8 +53,8 @@ router.get('/show', function(req, res, next) {
console
.
log
(
'select2 error'
);
res
.
status
(
400
).
send
({
err
:
err
});
}
else
{
let
gerFile
=
'SELECT * FROM files WHERE location = ? AND user_id = ?;'
;
connection
.
query
(
gerFile
,
[
location
,
user_id
],
function
(
err
,
file
)
{
let
gerFile
=
'SELECT * FROM files WHERE location = ? AND user_id = ?
AND folder_name != ?
;'
;
connection
.
query
(
gerFile
,
[
location
,
user_id
,
'trashcan'
],
function
(
err
,
file
)
{
if
(
err
)
{
console
.
log
(
'select3 error'
);
res
.
status
(
400
).
send
({
err
:
err
});
...
...
backend/routes/trashcan.js
View file @
baca0a1
...
...
@@ -7,6 +7,32 @@ var S3 = require(__dirname + '/modules/s3/s3');
const
s3
=
new
AWS
.
S3
();
router
.
get
(
'/show'
,
function
(
req
,
res
,
next
)
{
console
.
log
(
req
.
query
);
user_id
=
req
.
query
.
id
;
let
checkfolder
=
'SELECT * FROM folders WHERE location = ? AND user_id = ?;'
;
connection
.
query
(
checkfolder
,
[
'/trashcan/'
,
user_id
],
function
(
err
,
folder
)
{
if
(
err
)
{
console
.
log
(
'select error'
);
res
.
status
(
400
).
send
({
err
:
err
});
}
else
{
let
checkfile
=
'SELECT * FROM files WHERE location = ? AND user_id = ?;'
;
connection
.
query
(
checkfile
,
[
'/trashcan/'
,
user_id
],
function
(
err
,
file
)
{
if
(
err
)
{
console
.
log
(
'select error'
);
res
.
status
(
400
).
send
({
err
:
err
});
}
else
{
res
.
status
(
200
).
send
({
folders
:
folder
,
files
:
file
})
}
});
}
});
});
router
.
get
(
'/delfile'
,
function
(
req
,
res
,
next
)
{
var
file_id
=
req
.
query
.
file_id
;
var
user_id
=
req
.
query
.
id
;
...
...
Please
register
or
login
to post a comment