Commit ac3ddf08 authored by Yoon, Daeki's avatar Yoon, Daeki 😅
Browse files

Merge branch 'develop' into main-dev

parents 9d3f66f3 4a7a2303
...@@ -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>;
} }
......
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;
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.updateOnePost);
router.param("postId", postCtrl.userByPostId); router.param("postId", postCtrl.userByPostId);
export default router; export default router;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment