23 lines
611 B
TypeScript
23 lines
611 B
TypeScript
import { Router } from "express";
|
|
import RequestValidator from "../../middlewares/request_validator";
|
|
import { profile_controller } from "./profile.controller";
|
|
import { profile_validations } from "./profile.validation";
|
|
import auth from "../../middlewares/auth";
|
|
import uploader from "../../middlewares/uploader";
|
|
|
|
const router = Router();
|
|
|
|
router.patch(
|
|
"/",
|
|
auth("USER"),
|
|
uploader.single("file"),
|
|
(req, res, next) => {
|
|
req.body = JSON.parse(req?.body?.data);
|
|
next();
|
|
},
|
|
RequestValidator(profile_validations.update_profile),
|
|
profile_controller.update_profile,
|
|
);
|
|
|
|
export default router;
|