Skip to content

Commit

Permalink
Merge pull request #9 from KniteenK/niket
Browse files Browse the repository at this point in the history
hustler fixed
  • Loading branch information
KniteenK authored Oct 22, 2024
2 parents bec9bbe + 736ce1d commit 3e0083e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
15 changes: 7 additions & 8 deletions HustlePe-backend/src/controllers/authHustler.controller.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import jwt from "jsonwebtoken";
import { Application } from "../models/application.model.js";
import { Hustler } from "../models/hustler.model.js";
import { apiError } from "../utils/apiError.js";
import apiResponse from "../utils/apiResponse.js";
import asyncHandler from "../utils/asyncHandler.js";
import { uploadOnCloudinary } from "../utils/cloudinary.js";
import {Application} from "../models/application.model.js"

const signUpHustler = asyncHandler(async (req, res) => {
const { username, email, password, first_name, last_name, contactNumber, address } = req.body;
Expand Down Expand Up @@ -175,7 +175,7 @@ const getUser = asyncHandler (async (req , res) => {

const updateAvatar = asyncHandler (async (req , res) => {
const avatarLocalPath = req.file?.path

console.log('avatarLocalPath', avatarLocalPath)
if (!avatarLocalPath) {
throw new apiError(400, "Avatar is required");
}
Expand Down Expand Up @@ -257,13 +257,12 @@ const applyToJob = asyncHandler (async (req , res) => {
})

export {
changePassword,
getUser,
applyToJob, changePassword,
getUser,
logoutHustler,
refreshAccessToken,
signUpHustler,
refreshAccessToken,
signUpHustler,
updateAvatar,
updateCoverImage,
applyToJob
updateCoverImage
};

22 changes: 11 additions & 11 deletions HustlePe-backend/src/routes/hustlerAuth.routes.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import express from 'express';
import { upload } from '../middlewares/multer.middleware.js';
import { signUpHustler , logoutHustler, refreshAccessToken,changePassword,
getUser,
logoutHustler,
refreshAccessToken,
signUpHustler,
import {
applyToJob,
changePassword,
getUser,
refreshAccessToken,
signUpHustler,
updateAvatar,
updateCoverImage,
applyToJob}
from '../controllers/authHustler.controller.js';
import { verifyHustlerJWT } from '../middlewares/auth.middleware.js';
updateCoverImage
} from '../controllers/authHustler.controller.js';
import signIn from '../controllers/signIn.controller.js';
import { verifyHustlerJWT } from '../middlewares/auth.middleware.js';
import { upload } from '../middlewares/multer.middleware.js';

const router = express.Router();

Expand All @@ -31,7 +31,7 @@ router.route('/signUpHustler').post(upload.fields([

// Hustlers Routes
router.route('/signInHustler').post(signIn) ;
router.route('/logoutHustler').post(verifyHustlerJWT , logoutHustler) ;
// router.route('/logoutHustler').post(verifyHustlerJWT , logoutHustler) ;
router.route('/refreshToken').post(refreshAccessToken) ;

router.route('/updateAvatar').patch(updateAvatar);
Expand Down

0 comments on commit 3e0083e

Please sign in to comment.