Skip to content

Commit

Permalink
#36 게시글 작성 시 userId에 kakaoid-> userid 들어가게 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
AYoungSn committed Dec 19, 2021
1 parent 422f7b6 commit 65200a0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
8 changes: 5 additions & 3 deletions public/css/menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,18 @@
}

.login_btn {
text-align: right;
text-align: center;
padding: 10px;
display: inline-flexbox;
display: flex;
justify-content: center;
/* white-space: nowrap; */
}
.login {
font-size: 15px;
color: #8b8b8b;
display: inline;
align-items: baseline;
align-items: center;
text-align: center;
}
.menu_bg {
width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion routes/boardProcessRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ router.post('/', function(request, response) {
const body = request.body;
let title = body.title;
let content = body.content;
var userID = request.user.kakaoid;
var userID = request.user.id;


db.query(`INSERT INTO post (id, userID, title, content, createdate, updatedate) VALUES (?,?,?,?,now(),now())`, [null, userID, title, content, null, null], function(err, result){
Expand Down
2 changes: 1 addition & 1 deletion routes/boardRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ router.get('/view', function(request, response){
var like_num = 10000; // 좋아요 연결 후 반영하기
var content = result2[0].content;

db.query(`SELECT nickname FROM user WHERE kakaoid = ?;`, [userId], function(err3, result3){
db.query(`SELECT nickname FROM user WHERE id = ?;`, [userId], function(err3, result3){

var user_id = result3[0].nickname;

Expand Down
2 changes: 2 additions & 0 deletions template/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ module.exports = {
<div><a href="/likes">좋아요 리스트</a></div>
<div><a href="/logout">로그아웃</a></div>
`
} else {
menu_list += `<div><a href="/oauth/kakao">로그인</a></div>`
}
menu_list += `</div>`
return menu_list;
Expand Down

0 comments on commit 65200a0

Please sign in to comment.