Skip to content

Commit

Permalink
Add new routes for user controller
Browse files Browse the repository at this point in the history
  • Loading branch information
hiteshchoudhary committed Dec 20, 2023
1 parent a573049 commit 5d3bea9
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/routes/user.routes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
import { Router } from "express";
import { loginUser, logoutUser, registerUser, refreshAccessToken } from "../controllers/user.controller.js";
import {
loginUser,
logoutUser,
registerUser,
refreshAccessToken,
changeCurrentPassword,
getCurrentUser,
updateUserAvatar,
updateUserCoverImage,
getUserChannelProfile,
getWatchHistory
} from "../controllers/user.controller.js";
import {upload} from "../middlewares/multer.middleware.js"
import { verifyJWT } from "../middlewares/auth.middleware.js";

Expand All @@ -25,5 +36,14 @@ router.route("/login").post(loginUser)
//secured routes
router.route("/logout").post(verifyJWT, logoutUser)
router.route("/refresh-token").post(refreshAccessToken)
router.route("/change-password").post(verifyJWT, changeCurrentPassword)
router.route("/current-user").get(verifyJWT, getCurrentUser)
router.route("/update-account").patch(verifyJWT, updateAccountDetails)

router.route("/avatar").patch(verifyJWT, upload.single("avatar"), updateUserAvatar)
router.route("/cover-image").patch(verifyJWT, upload.single("/coverImage"), updateUserCoverImage)

router.route("/c/:username").get(verifyJWT, getUserChannelProfile)
router.route("/history").get(verifyJWT, getWatchHistory)

export default router

0 comments on commit 5d3bea9

Please sign in to comment.