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 {
city: string;
date: Date | number;
counts?: number;
user: Types.ObjectId | string;
user?: Types.ObjectId | string;
file?: Array<Types.ObjectId>;
}
......
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;
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.updateOnePost);
router.param("postId", postCtrl.userByPostId);
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