Toggle navigation
Toggle navigation
This project
Loading...
Sign in
최시원
/
Singer-Composer
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
choi
2021-11-17 17:36:37 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
fd450fe7f10a5391ff4cee83b013076b5ce80c4c
fd450fe7
1 parent
f15df7da
Add the bulletin update function
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
router/board/index.js
router/board/index.js
View file @
fd450fe
...
...
@@ -53,4 +53,25 @@ router.get('/read/:idx', function(req,res,next){
})
})
router
.
post
(
'/update'
,
function
(
req
,
res
,
next
){
var
idx
=
req
.
body
.
idx
var
name
=
req
.
body
.
name
var
title
=
req
.
body
.
title
var
content
=
req
.
body
.
content
var
passwd
=
req
.
body
.
passwd
var
datas
=
[
name
,
title
,
content
,
idx
,
passwd
]
var
sql
=
"update board set name = ?,title=?,content=?,modidate=now() where idx =? and passwd=?"
board
.
query
(
sql
,
datas
,
function
(
err
,
result
){
if
(
err
)
console
.
error
(
err
)
if
(
result
.
affectedRows
==
0
){
res
.
send
(
"<script>alert('패스워드가 일치하지 않습니다.');history.back();</script>"
)
}
else
{
res
.
redirect
(
'/board/read/'
+
idx
)
}
})
})
module
.
exports
=
router
;
\ No newline at end of file
...
...
Please
register
or
login
to post a comment