@@ -2,16 +2,16 @@ var express = require('express');
varasync=require('async');
varrouter=express.Router();
functiongetMyToons(id,cb){
functiongetMyToons(id,cb){
//id 값을 가진 user가 저장한 웹툰들 가져오기
varsqlquery="SELECT t.toon_index, t.name, t.thum_link, t.webtoon_link, t.week, 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;";
connection.query("DELETE FROM user_toon_relation WHERE user_id='"+id+"' && toon_index='"+index+"';",[id,index],function(err,rows,result){
if(err){
console.log("내 웹툰 제거중 에러!");
throwerr;
}else{
//alert("제거되었습니다.")
alert("제거되었습니다.")
res.redirect('/setting');
}
});
}else{
addMyToons(id,index,function(){
addMyToons(id,index,function(){
res.redirect('/setting');
});
}
...
...
@@ -47,11 +46,11 @@ function getMyToons(id,cb){
//mysql5.7 syntax에 맞게 수정 => 로그인한 유저의
varsqlquery="SELECT t.toon_index, t.name, t.thum_link, t.webtoon_link, t.week, 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;";