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 {
...
@@ -7,7 +7,7 @@ export interface PostType {
city
:
string
;
city
:
string
;
date
:
Date
|
number
;
date
:
Date
|
number
;
counts
?:
number
;
counts
?:
number
;
user
:
Types
.
ObjectId
|
string
;
user
?
:
Types
.
ObjectId
|
string
;
file
?:
Array
<
Types
.
ObjectId
>
;
file
?:
Array
<
Types
.
ObjectId
>
;
}
}
...
...
src/routes/mainimg.route.ts
View file @
ac3ddf08
import
express
from
"
express
"
;
import
express
from
"
express
"
;
import
{
mainimgCtrl
,
authCtrl
}
from
"
../controllers
"
;
import
{
mainimgCtrl
,
authCtrl
,
fileInfoCtrl
}
from
"
../controllers
"
;
const
router
=
express
.
Router
();
const
router
=
express
.
Router
();
...
@@ -11,7 +11,7 @@ router
...
@@ -11,7 +11,7 @@ router
router
router
.
route
(
"
/:imgId
"
)
.
route
(
"
/:imgId
"
)
.
delete
(
authCtrl
.
requireLogin
,
authCtrl
.
hasRole
(
"
admin
"
),
mainimgCtrl
.
deleteMainimg
)
.
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
;
export
default
router
;
src/routes/post.route.ts
View file @
ac3ddf08
import
express
from
"
express
"
;
import
express
from
"
express
"
;
import
{
postCtrl
,
authCtrl
,
fileInfoCtrl
}
from
"
../controllers
"
;
import
{
postCtrl
,
authCtrl
}
from
"
../controllers
"
;
const
router
=
express
.
Router
();
const
router
=
express
.
Router
();
...
@@ -8,12 +8,11 @@ router.route("/").get(postCtrl.getAllPost);
...
@@ -8,12 +8,11 @@ router.route("/").get(postCtrl.getAllPost);
router
.
route
(
"
/files/:postId
"
).
get
(
authCtrl
.
requireLogin
,
postCtrl
.
getFiles
);
router
.
route
(
"
/files/:postId
"
).
get
(
authCtrl
.
requireLogin
,
postCtrl
.
getFiles
);
// router.param("postId", postCtrl.userByPostId);
router
router
.
route
(
"
/:postId
"
)
.
route
(
"
/:postId
"
)
.
post
(
authCtrl
.
requireLogin
,
postCtrl
.
addCounts
)
.
post
(
authCtrl
.
requireLogin
,
postCtrl
.
addCounts
)
.
delete
(
authCtrl
.
requireLogin
,
postCtrl
.
deleteOnePost
)
// +authenticate
.
delete
(
authCtrl
.
requireLogin
,
authCtrl
.
authenticate
,
postCtrl
.
deleteOnePost
)
.
put
(
authCtrl
.
requireLogin
,
postCtrl
.
updatePost
);
.
put
(
authCtrl
.
requireLogin
,
postCtrl
.
update
One
Post
);
router
.
param
(
"
postId
"
,
postCtrl
.
userByPostId
);
router
.
param
(
"
postId
"
,
postCtrl
.
userByPostId
);
export
default
router
;
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