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
travel
Commits
ac3ddf08
Commit
ac3ddf08
authored
Jul 27, 2022
by
Yoon, Daeki
😅
Browse files
Merge branch 'develop' into main-dev
parents
9d3f66f3
4a7a2303
Changes
23
Show whitespace changes
Inline
Side-by-side
src/models/post.model.ts
View file @
ac3ddf08
...
...
@@ -7,7 +7,7 @@ export interface PostType {
city
:
string
;
date
:
Date
|
number
;
counts
?:
number
;
user
:
Types
.
ObjectId
|
string
;
user
?
:
Types
.
ObjectId
|
string
;
file
?:
Array
<
Types
.
ObjectId
>
;
}
...
...
src/routes/mainimg.route.ts
View file @
ac3ddf08
import
express
from
"
express
"
;
import
{
mainimgCtrl
,
authCtrl
}
from
"
../controllers
"
;
import
{
mainimgCtrl
,
authCtrl
,
fileInfoCtrl
}
from
"
../controllers
"
;
const
router
=
express
.
Router
();
...
...
@@ -11,7 +11,7 @@ router
router
.
route
(
"
/:imgId
"
)
.
delete
(
authCtrl
.
requireLogin
,
authCtrl
.
hasRole
(
"
admin
"
),
mainimgCtrl
.
deleteMainimg
)
.
put
(
authCtrl
.
requireLogin
,
authCtrl
.
hasRole
(
"
admin
"
),
mainimgCtrl
.
updateMainimg
);
.
put
(
authCtrl
.
requireLogin
,
authCtrl
.
hasRole
(
"
admin
"
),
fileInfoCtrl
.
uploadFile
,
mainimgCtrl
.
updateMainimg
);
export
default
router
;
src/routes/post.route.ts
View file @
ac3ddf08
import
express
from
"
express
"
;
import
{
postCtrl
,
authCtrl
,
fileInfoCtrl
}
from
"
../controllers
"
;
import
{
postCtrl
,
authCtrl
}
from
"
../controllers
"
;
const
router
=
express
.
Router
();
...
...
@@ -8,12 +8,11 @@ router.route("/").get(postCtrl.getAllPost);
router
.
route
(
"
/files/:postId
"
).
get
(
authCtrl
.
requireLogin
,
postCtrl
.
getFiles
);
// router.param("postId", postCtrl.userByPostId);
router
.
route
(
"
/:postId
"
)
.
post
(
authCtrl
.
requireLogin
,
postCtrl
.
addCounts
)
.
delete
(
authCtrl
.
requireLogin
,
postCtrl
.
deleteOnePost
)
// +authenticate
.
put
(
authCtrl
.
requireLogin
,
postCtrl
.
updatePost
);
.
delete
(
authCtrl
.
requireLogin
,
authCtrl
.
authenticate
,
postCtrl
.
deleteOnePost
)
.
put
(
authCtrl
.
requireLogin
,
postCtrl
.
update
One
Post
);
router
.
param
(
"
postId
"
,
postCtrl
.
userByPostId
);
export
default
router
;
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