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:57:39 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1abacfd6fb1ee15e4a07d6acbbe8bc3702eda4a1
1abacfd6
1 parent
3484cb6e
.
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
backend/routes/folders.js
backend/routes/folders.js
View file @
1abacfd
...
...
@@ -47,14 +47,14 @@ router.get('/show', function(req, res, next) {
folder_id
=
req
.
query
.
folder_id
;
if
(
folder_id
==
-
1
)
{
let
location
=
'/'
;
let
gerFolder
=
'SELECT * FROM folders WHERE location = ? AND user_id = ?;'
;
connection
.
query
(
gerFolder
,
[
location
,
user_id
],
function
(
err
,
folder
)
{
let
gerFolder
=
'SELECT * FROM folders WHERE location = ? AND user_id = ?
AND folder_name != ?
;'
;
connection
.
query
(
gerFolder
,
[
location
,
user_id
,
'trashcan'
],
function
(
err
,
folder
)
{
if
(
err
)
{
console
.
log
(
'select2 error'
);
res
.
status
(
400
).
send
({
err
:
err
});
}
else
{
let
gerFile
=
'SELECT * FROM files WHERE location = ? AND user_id = ?
AND folder_name != ?
;'
;
connection
.
query
(
gerFile
,
[
location
,
user_id
,
'trashcan'
],
function
(
err
,
file
)
{
let
gerFile
=
'SELECT * FROM files WHERE location = ? AND user_id = ?;'
;
connection
.
query
(
gerFile
,
[
location
,
user_id
],
function
(
err
,
file
)
{
if
(
err
)
{
console
.
log
(
'select3 error'
);
res
.
status
(
400
).
send
({
err
:
err
});
...
...
@@ -80,8 +80,8 @@ router.get('/show', function(req, res, next) {
res
.
status
(
400
).
send
({
err
:
'does not exist'
});
}
else
{
let
location
=
rows
[
0
].
location
+
rows
[
0
].
folder_name
+
'/'
;
let
gerFolder
=
'SELECT * FROM folders WHERE location = ? AND user_id = ?;'
;
connection
.
query
(
gerFolder
,
[
location
,
user_id
],
function
(
err
,
folder
)
{
let
gerFolder
=
'SELECT * FROM folders WHERE location = ? AND user_id = ?
AND folder_name != ?
;'
;
connection
.
query
(
gerFolder
,
[
location
,
user_id
,
'trashcan'
],
function
(
err
,
folder
)
{
if
(
err
)
{
console
.
log
(
'select2 error'
);
res
.
status
(
400
).
send
({
err
:
err
});
...
...
Please
register
or
login
to post a comment