From 0509d4eefb9023bd6aea8d37cdaba6ea49689ed9 Mon Sep 17 00:00:00 2001 From: Mridul Goel Date: Sun, 20 Oct 2024 18:09:15 +0530 Subject: [PATCH] Refactor clientAuth.routes.js to include additional route handlers for changing password, email, username, address, avatar, cover image, contact number, and organization --- .../src/controllers/authClient.controller.js | 2 +- .../src/routes/hustlerAuth.routes.js | 20 ++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/HustlePe-backend/src/controllers/authClient.controller.js b/HustlePe-backend/src/controllers/authClient.controller.js index b8dd7d6..90b5f40 100644 --- a/HustlePe-backend/src/controllers/authClient.controller.js +++ b/HustlePe-backend/src/controllers/authClient.controller.js @@ -417,7 +417,7 @@ const postGig = asyncHandler ( async (req , res) => { }) ; res.status(201).json( new apiResponse(201, gig, "Gig created successfully") - ) ; + ); } catch (error) { console.error ("error : " , error.message || 'Something went horribly wrong') } diff --git a/HustlePe-backend/src/routes/hustlerAuth.routes.js b/HustlePe-backend/src/routes/hustlerAuth.routes.js index 92bbf03..9986832 100644 --- a/HustlePe-backend/src/routes/hustlerAuth.routes.js +++ b/HustlePe-backend/src/routes/hustlerAuth.routes.js @@ -1,6 +1,14 @@ import express from 'express'; import { upload } from '../middlewares/multer.middleware.js'; -import { signUpHustler , logoutHustler, refreshAccessToken} from '../controllers/authHustler.controller.js'; +import { signUpHustler , logoutHustler, refreshAccessToken,changePassword, + getUser, + logoutHustler, + refreshAccessToken, + signUpHustler, + updateAvatar, + updateCoverImage, + applyToJob} + from '../controllers/authHustler.controller.js'; import { verifyHustlerJWT } from '../middlewares/auth.middleware.js'; import signIn from '../controllers/signIn.controller.js'; @@ -18,9 +26,19 @@ router.route('/signUpHustler').post(upload.fields([ ]) , signUpHustler) ; +// getUser, +// applyToJob + // Hustlers Routes router.route('/signInHustler').post(signIn) ; router.route('/logoutHustler').post(verifyHustlerJWT , logoutHustler) ; router.route('/refreshToken').post(refreshAccessToken) ; +router.route('/updateAvatar').patch(updateAvatar); +router.route('/updateCoverImage').patch(updateCoverImage); +router.route('/changePassword').patch(changePassword); +router.route('/applyToJob').post(applyToJob); +router.route('/getUser').get(verifyHustlerJWT , getUser) ; + + export default router; \ No newline at end of file