Skip to content

Commit

Permalink
removed few console logs
Browse files Browse the repository at this point in the history
  • Loading branch information
iam-abin committed Mar 26, 2024
1 parent 0d6d7ed commit 290eb22
Show file tree
Hide file tree
Showing 26 changed files with 32 additions and 126 deletions.
2 changes: 0 additions & 2 deletions admin/src/useCases/candidate/get-candidate-by-id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ export = (dependencies: any) => {
}

const execute = (userId: string) => {
console.log("inside get candidate profile by id repo, " ,userId);

return candidateRepository.getById(userId);
};

Expand Down
9 changes: 0 additions & 9 deletions admin/src/useCases/dashboard/get-dashboard-graph-details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ export = (dependencies: any) => {
palmentPlanNamesArray.forEach((paymentPlan: string) => {
arrays[paymentPlan] = new Array(12).fill(0);
});
// let obj: any = {}
// obj.name = paymentPlans[i].name
// obj.data = palmentPlanNamesArray.push(paymentPlans[i].name);

console.log(arrays); // Output: { premium: [], gold: [] }

for(let payment of monthlyPayments){
Expand All @@ -43,11 +39,6 @@ export = (dependencies: any) => {
"inside get dashboard graph details usecase ",
monthlyPayments
);
// console.log(
// "inside get dashboard graph details paymentPlans usecase ",
// palmentPlanNamesSet
// );

console.log(
"inside get dashboard graph details paymentPlans usecase array of Objects ",
arrays
Expand Down
3 changes: 0 additions & 3 deletions auth/src/controllers/admin/signin.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@ export = (dependencies: DependenciesData) => {
).execute(email);

if (!isExistingUser) {
// return res.status(400).json({message:"Invalid email or password"})

throw new BadRequestError("Invalid email or password");
}

if (isExistingUser.userType !== "admin") throw new BadRequestError("Invalid Admin");


// check password is correct
const isSamePassword = password === isExistingUser.password;

Expand Down
11 changes: 0 additions & 11 deletions auth/src/controllers/candidate/signin.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,35 +22,24 @@ export = (dependencies: DependenciesData) => {
).execute(email);

if (!isExistingUser) {
// return res.status(400).json({message:"Invalid email or password"})

throw new BadRequestError("Invalid email or password");
}




// check password is correct
const isSamePassword = await comparePassword(
password,
isExistingUser.password
);

if (!isSamePassword) {
// return res.status(400).json({message:"Invalid email or passwordd"})

throw new BadRequestError("Invalid email or passwordd");
}

if (isExistingUser.userType !== "candidate") {
// return res.status(400).json({message:"Invalid email or password"})

throw new BadRequestError("Invalid Candidate");
}

if (!isExistingUser.isActive) {
// return res.status(400).json({message:"Invalid email or passwordd"})

throw new BadRequestError("This is a blocked user");
}

Expand Down
3 changes: 0 additions & 3 deletions auth/src/controllers/candidate/signout.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import { DependenciesData } from "../../frameworks/types/dependencyInterface";

export = (dependencies: DependenciesData) => {
return async (req: Request, res: Response) => {
console.log(req.currentUserCandidate, "req.currentUser in candidate controller");
console.log(req.headers, "req.headers in candidate controller");

// req.session!.candidateToken = null
res.status(200).json({ message: "candidate successfully logged out" });
};
Expand Down
15 changes: 0 additions & 15 deletions auth/src/controllers/candidate/signup.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export = (dependencies: DependenciesData) => {
).execute(email);

if (isExistingUser && isExistingUser.isVarified) {
// return res.status(400).json({message:"Email already exist"})
throw new BadRequestError("Email already exist");
}

Expand All @@ -29,11 +28,6 @@ export = (dependencies: DependenciesData) => {
if(isExistingUser && !isExistingUser.isVarified){
// const token = await getEmailVerifyTokenUseCase(dependencies).execute(email)
const response = await sendVerificationEmail(isExistingUser.email, isExistingUser.otp ,subject ,topic);
// if(response){
// return res.status(200).json({"message": "An email is send to your email, please verify."});
// }else{
// return res.status(200).json({"message": "An email is send to your email, please verify."});
// }
console.log("email sended response ", response);
return res.status(200).json({"message": `An email is send to ${isExistingUser.email}, please verify.`});
}
Expand All @@ -57,15 +51,6 @@ export = (dependencies: DependenciesData) => {
}



// to add values to otp collection,
// const emailVerify = await createEmailVerificationOtpUseCase(dependencies).execute({
// userId: newUser._id,
// email: newUser.email,
// otp: otp,
// expiry: expiryTime
// });

console.log("-------newUserCandidate ",newUser);
console.log("-------newUser._id",newUser._id);

Expand Down
4 changes: 0 additions & 4 deletions auth/src/controllers/jwtRefresh/jwt-refresh.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@ export = (dependencies: DependenciesData) => {
} = dependencies;

return async (req: Request, res: Response) => {
console.log("inside refresh token controller");
console.log("inside refresh token controller req.headers", req.headers);

let refreshToken;
if (req.headers.authorization) {
const authHeader = req.headers.authorization;
console.log("inside refresh token controller===== req.headers.authorization ",req.headers.authorization);
if (authHeader.startsWith("Bearer ")) {
refreshToken = authHeader.substring("Bearer ".length);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ export = (dependencies: DependenciesData) => {
if (!user) {
throw new BadRequestError("Invalid email");
}
console.log(user, "fetched user");


const checkOtp = await checkEmailVerificationOtpUseCase(
dependencies
).execute({ otp: parsedOtp, email });
Expand Down
5 changes: 0 additions & 5 deletions auth/src/controllers/recruiter/signup.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ export = (dependencies: DependenciesData) => {
const topic = "Enter the 6 digit otp to verify your email"
if(isExistingUser && !isExistingUser.isVarified){
const response = await sendVerificationEmail(isExistingUser.email, isExistingUser.otp ,subject ,topic);
// if(response){
// return res.status(200).json({"message": "An email is send to your email, please verify."});
// }else{
// return res.status(200).json({"message": "An email is send to your email, please verify."});
// }
console.log("email sended response ", response);
return res.status(200).json({"message": "An email is send to your email, please verify."});
}
Expand Down
4 changes: 0 additions & 4 deletions chat/src/controllers/chat/get-all-chat-rooms.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ export = (dependencies: DependenciesData)=>{

return async (req: Request, res: Response)=>{
const {userId} = req.params
console.log("in get all chatroom controller 1: ",userId);

const chatRooms = await getChatRoomsUseCase(dependencies).execute(userId);
console.log("in get all chatroom controller 2: ",chatRooms);


res.status(200).json({message: "Chat rooms are ", data: chatRooms })
};
Expand Down
8 changes: 2 additions & 6 deletions chat/src/controllers/chat/get-conversation.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ export = (dependencies: DependenciesData)=>{
const { useCases: { getConversationUseCase }} = dependencies

return async (req: Request, res: Response)=>{
const {chatRoomId} = req.params
console.log("in get conversation controller 1: ",chatRoomId);

const {chatRoomId} = req.params;
const conversation = await getConversationUseCase(dependencies).execute(chatRoomId);
console.log("in get conversation controller 2: ",chatRoomId);



res.status(200).json({message: "Conversations are ", data: conversation })
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ export = (dependencies: DependenciesData)=>{
const { useCases: { createNotificationUseCase }} = dependencies

return async (req: Request, res: Response)=>{
const { notificationData } = req.body
console.log("in createNotification controller 1: ",notificationData);

const { notificationData } = req.body;
const notification = await createNotificationUseCase(dependencies).execute(notificationData);
console.log("in createNotification controller 2: ",notificationData);


res.status(201).json({message: "Notifications are ", data: notification })
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@ export = (dependencies: DependenciesData)=>{
return async (req: Request, res: Response)=>{
const { senderId } = req.params;
const {receiverId} = req.params;
console.log("in get conversation controller senderId 1: ", senderId );
console.log("in get conversation controller receiverId 1: ", receiverId );

const response = await deleteAllNotificationsBySenderIdUseCase(dependencies).execute( senderId, receiverId );
console.log("in get response controller 2: ", senderId, receiverId );



res.status(200).json({message: "response is ", data: response })
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ export = (dependencies: DependenciesData)=>{
const { useCases: { deleteAllNotificationsUseCase }} = dependencies

return async (req: Request, res: Response)=>{
const { userId } = req.params
console.log("in get conversation controller 1: ", userId );
const { userId } = req.params;

const response = await deleteAllNotificationsUseCase(dependencies).execute( userId );
console.log("in get response controller 2: ", userId );


res.status(200).json({message: "response is ", data: response })
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@ export = (dependencies: DependenciesData)=>{
const { useCases: { getAllNotificationsCountUseCase }} = dependencies

return async (req: Request, res: Response)=>{
const {userId} = req.params
console.log("in getAllNotifications count controller 1: ",userId);

const {userId} = req.params;
const notification = await getAllNotificationsCountUseCase(dependencies).execute(userId);

console.log("in getAllNotifications count controller 2: ",notification);


res.status(200).json({message: "Notifications count are ", data: notification })
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ export = (dependencies: DependenciesData)=>{
const { useCases: { getAllNotificationsUseCase }} = dependencies

return async (req: Request, res: Response)=>{
const {userId} = req.params
console.log("in getAllNotifications controller 1: ",userId);

const {userId} = req.params;
const notification = await getAllNotificationsUseCase(dependencies).execute(userId);
console.log("in getAllNotifications controller 2: ",notification);


res.status(200).json({message: "Notifications are ", data: notification })
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@ export = (dependencies: DependenciesData)=>{
return async (req: Request, res: Response)=>{
const { senderId } = req.params;
const {receiverId} = req.params;
console.log("in getUnreadMessagesCount controller senderId 1: ", senderId );
console.log("in getUnreadMessagesCount controller receiverId 1: ", receiverId );

const response = await getUnreadMessagesCountUseCase(dependencies).execute(receiverId, senderId );
console.log("in get response controller 2: ", senderId, receiverId );

const response = await getUnreadMessagesCountUseCase(dependencies).execute(receiverId, senderId )

res.status(200).json({message: "response is ", data: response })
};
Expand Down
6 changes: 1 addition & 5 deletions chat/src/controllers/user/search-user.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ export = (dependencies: DependenciesData)=>{
const { useCases: { getUsersUseCase }} = dependencies

return async (req: Request, res: Response)=>{
const keyword = req.query.search
console.log("in Job Applications controller 1: ",keyword);

const keyword = req.query.search;
const applications = await getUsersUseCase(dependencies).execute(keyword);
console.log("in Job Applications controller 2: ",applications);


res.status(200).json({message: "Job applications are ", data: applications })
};
Expand Down
4 changes: 2 additions & 2 deletions chat/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ const start = async () => {

const userUpdatedEvent = new UserUpdatedEventConsumer(kafkaClient);

// await userUpdatedEvent.subscribe();
// await userCreatedEvent.subscribe();
await userUpdatedEvent.subscribe();
await userCreatedEvent.subscribe();

httpServer.listen(3000, () => {
console.log("chat service Listening on port 3000....");
Expand Down
4 changes: 2 additions & 2 deletions client/src/config/baseUrl.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

export const BASE_URL = "https://abinvarghese.online/api/v1"
// export const BASE_URL = "https://abinvarghese.online/api/v1"

// export const BASE_URL = "https://devhive.dev/api/v1"
export const BASE_URL = "https://devhive.dev/api/v1"
20 changes: 10 additions & 10 deletions client/src/config/socket.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { io, Socket } from "socket.io-client";


const socket: Socket = io("https://abinvarghese.online", {
transports: ["websocket"],
path: "/api/v1/chat/socket.io",
withCredentials: true,
autoConnect: false,
});



// const socket: Socket = io("https://devhive.dev", {
// const socket: Socket = io("https://abinvarghese.online", {
// transports: ["websocket"],
// path: "/api/v1/chat/socket.io",
// withCredentials: true,
// autoConnect: false,
// });



const socket: Socket = io("https://devhive.dev", {
transports: ["websocket"],
path: "/api/v1/chat/socket.io",
withCredentials: true,
autoConnect: false,
});

export default socket;
6 changes: 3 additions & 3 deletions job/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ const start = async () => {
const jobUpdatedEvent = new jobUpdatedEventConsumer(kafkaClient);


// await userUpdatedEvent.subscribe();
// await userCreatedEvent.subscribe();
// await jobUpdatedEvent.subscribe();
await userUpdatedEvent.subscribe();
await userCreatedEvent.subscribe();
await jobUpdatedEvent.subscribe();

app.listen(3000, () => {
console.log("job service Listening on port 3000....");
Expand Down
2 changes: 0 additions & 2 deletions payment/src/controllers/payment/create-payment.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ export = (dependencies: DependenciesData) => {
amount,
);
console.log("in paymentCreated controller 2: ", paymentCreated);
// const paymentCreated = new Payment({})


const paymentCreatedEvent = new PremiumPaymentDonePublisher(kafkaClient);

Expand Down
8 changes: 4 additions & 4 deletions payment/src/useCase/payment/create-payment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ export = (dependencies: DependenciesData) => {
},
],
mode: "payment",
success_url: `https://abinvarghese.online/candidate/payment-success`,
cancel_url: `https://abinvarghese.online/candidate/payment-failed`,
// success_url: `https://devhive.dev/candidate/payment-success`,
// cancel_url: `https://devhive.dev/candidate/payment-failed`,
// success_url: `https://abinvarghese.online/candidate/payment-success`,
// cancel_url: `https://abinvarghese.online/candidate/payment-failed`,
success_url: `https://devhive.dev/candidate/payment-success`,
cancel_url: `https://devhive.dev/candidate/payment-failed`,
});

// return session
Expand Down
2 changes: 0 additions & 2 deletions profile/src/controllers/recruiter/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// import createRecruiterProfileController from "./create-profile.controller";
import viewCompanyProfileController from "./view-company-profile.controller";
import viewRecruiterProfileController from "./view-profile.controller";
import updateCompanyProfileController from "./update-company-profile.controller";
Expand All @@ -13,7 +12,6 @@ export = (dependencies: DependenciesData)=>{
return {
viewRecruiterProfileController: viewRecruiterProfileController(dependencies),
viewCompanyProfileController: viewCompanyProfileController(dependencies),
// createRecruiterProfileController: createRecruiterProfileController(dependencies),
updateRecruiterProfileController: updateRecruiterProfileController(dependencies),
updateCompanyProfileController: updateCompanyProfileController(dependencies),
uploadRecruiterProfilePicController: uploadRecruiterProfilePicController(dependencies),
Expand Down
Loading

0 comments on commit 290eb22

Please sign in to comment.