Skip to content

Commit

Permalink
Merge pull request #8 from KniteenK/pushOn20Oct
Browse files Browse the repository at this point in the history
Refactor clientAuth.routes.js to include additional route handlers fo…
  • Loading branch information
mrid07 authored Oct 20, 2024
2 parents 95e9f3f + 0509d4e commit bec9bbe
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion HustlePe-backend/src/controllers/authClient.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down
20 changes: 19 additions & 1 deletion HustlePe-backend/src/routes/hustlerAuth.routes.js
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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;

0 comments on commit bec9bbe

Please sign in to comment.