Toggle navigation
Toggle navigation
This project
Loading...
Sign in
이하영
/
YTMT
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
이진아
2019-12-06 14:31:23 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
28c55b9a2548bf31bd7a304bcc59fa2394126dbf
28c55b9a
1 parent
28200d65
mytoons2.js
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
routes/mytoons2.js
routes/mytoons2.js
0 → 100644
View file @
28c55b9
var
express
=
require
(
'express'
);
var
async
=
require
(
'async'
);
var
router
=
express
.
Router
();
function
getMyToons2
(
id
,
cb
){
//id 값을 가진 user가 저장한 웹툰들 가져오기
var
sqlquery
=
"SELECT t.name, t.thum_link, t.webtoon_link, t.year, t.site FROM user u, user_toon_relation ur, toon t WHERE u.id = '"
+
id
+
"' && u.id=ur.user_id && t.toon_index=ur.toon_index;"
;
var
mylist2
=
new
Array
();
connection
.
query
(
sqlquery
,
id
,
function
(
err
,
rows
,
result
){
if
(
!
err
){
mylist2
=
rows
;
cb
(
mylist2
);
console
.
log
(
mylist2
);
}
else
{
console
.
log
(
"내 웹툰 리스트 가져오는데 실패했습니다!"
);
//throw err;
}
});
}
/* GET home page. */
router
.
get
(
'/'
,
function
(
req
,
res
,
next
)
{
if
(
!
req
.
isAuthenticated
()){
res
.
redirect
(
'/'
);
}
else
{
async
.
series
(
[
function
(
callback
){
getMyToons2
(
req
.
user
.
user_id
,
function
(
mytoon_list2
)
{
callback
(
null
,
mytoon_list2
);
});
}
],
function
(
err
,
results
){
res
.
render
(
'mytoons2'
,
{
mytoons2
:
results
[
0
]
});
}
);
}
});
module
.
exports
=
router
;
\ No newline at end of file
Please
register
or
login
to post a comment