Commit 14bcff90 authored by Lee Soobeom's avatar Lee Soobeom
Browse files

Merge remote-tracking branch 'origin/MK20' into develop

parents 35f41d6b 154cb55a
import express from "express"; import express from "express";
import { userCtrl, authCtrl } from "../controllers"; import { userCtrl, authCtrl, fileInfoCtrl } from "../controllers";
const router = express.Router(); const router = express.Router();
router router
.route("/") .route("/")
.get(authCtrl.requireLogin, userCtrl.getProfile) .get(authCtrl.requireLogin, userCtrl.getProfile)
.post(authCtrl.requireLogin, userCtrl.postPicture); //중간에 req쪽에 fields와 files 넣는 미들웨어 추가 .post(authCtrl.requireLogin, fileInfoCtrl.uploadFile, userCtrl.postPicture); //중간에 req쪽에 fields와 files 넣는 미들웨어 추가
router.route("/delete").post(authCtrl.requireLogin, userCtrl.deleteUser); router.route("/delete").delete(authCtrl.requireLogin, userCtrl.deleteUser);
export default router; export default router;
import express from "express"; import express from "express";
import { userCtrl, authCtrl } from "../controllers"; import { userCtrl, authCtrl, fileInfoCtrl } from "../controllers";
const router = express.Router(); const router = express.Router();
router router
.route("/") .route("/")
.get(authCtrl.requireLogin, userCtrl.getUsers) .get(authCtrl.requireLogin, userCtrl.getUsers)
.post(authCtrl.requireLogin, authCtrl.hasRole("admin"), userCtrl.createUser); .post(
authCtrl.requireLogin,
authCtrl.hasRole("admin"),
fileInfoCtrl.uploadFile,
userCtrl.createUser
);
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