Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
reservation-service
Commits
7de8fc28
Commit
7de8fc28
authored
Nov 06, 2020
by
Kim, Subin
Browse files
교수님 여기요! 11.06.04:00
parent
3ed89fa4
Changes
22
Hide whitespace changes
Inline
Side-by-side
server/routes/writes.js
View file @
7de8fc28
...
...
@@ -10,7 +10,7 @@ router.post('/', function (req, res, next) {
console
.
log
(
"
writes req.body
"
,
req
.
body
)
const
notice
=
new
Notice
({
notice_title
:
req
.
body
.
title
,
notice_author
:
"
예진
"
,
notice_author
:
req
.
body
.
name
,
notice_content
:
req
.
body
.
content
});
console
.
log
(
notice
);
...
...
@@ -26,11 +26,13 @@ router.post('/', function (req, res, next) {
});
router
.
put
(
'
/:id
'
,
function
(
req
,
res
,
next
)
{
console
.
log
(
'
/writes put req.
body
'
,
req
.
params
)
console
.
log
(
'
/writes put req.
params
'
,
req
.
params
.
id
)
Notice
.
findOne
({
_id
:
req
.
params
.
id
},
function
(
err
,
notice
)
{
if
(
err
)
return
res
.
status
(
500
).
json
({
error
:
err
});
notice
.
notice_title
=
req
.
body
.
title
+
"
(수정)
"
;
notice
.
post_date
=
req
.
body
.
post_date
;
if
(
req
.
body
.
title
.
indexOf
(
"
(수정)
"
)
===
-
1
)
{
notice
.
notice_title
=
req
.
body
.
title
+
"
(수정)
"
}
else
{
notice
.
notice_title
=
req
.
body
.
title
}
notice
.
post_date
=
new
Date
();
notice
.
notice_author
=
req
.
body
.
name
;
notice
.
notice_content
=
req
.
body
.
content
;
notice
.
save
()
.
then
((
result
)
=>
{
...
...
server/schemas/notice.js
View file @
7de8fc28
...
...
@@ -11,7 +11,6 @@ const noticeSchema = new Schema({
},
notice_author
:
{
type
:
String
,
// default: "나야나"
required
:
true
,
},
post_date
:
{
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment