-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update hiring status in mongodb db and change button behaviour #194
Conversation
Merge main into suraj-frontned
server/src/routes/interviews.ts
Outdated
@@ -14,6 +14,7 @@ router.patch("/update/:id", auth, updateMeeting); | |||
|
|||
// TODO: add super admin middleware | |||
router.patch("/update", updateAllInterviews); | |||
router.patch("/hiring/:id", updateHiringStatus); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only hr can update the hiring status
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated accordingly
const updatedMeetingResponse = await Interview.findByIdAndUpdate( | ||
meetingId, | ||
updatedMeeting, | ||
{ new: true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why new - true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new: This is a boolean-type option. If true, return the modified document rather than the original.
@@ -15,7 +17,11 @@ const parseEvaluationText = (text) => { | |||
}; | |||
|
|||
const EvaluationPopup = ({ evaluationData, onClose, interviewDetails }) => { | |||
console.log("interviewDetails", interviewDetails) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove log
let parsedEvaluationData = {}; | ||
const dispatch = useDispatch(); | ||
const [currentHiringStatus, setCurrentHiringStatus] = | ||
useState("Decision Pending"); | ||
|
||
const sendHiringStatusEmail = (hiringDecision) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please update this function. get url from .env instead of hardcode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getting from env is not working in my machine, i am hardcoding in client/src/api/index.js
@@ -54,6 +54,7 @@ export const getMeeting = (id) => API.get(`/interviews/${id}`); | |||
// export const scheduleMeeting = (meetingData) => API.post('/schedule', meetingData); | |||
export const scheduleMeeting = (formData) => API.post(`/interviews/schedule`, formData); | |||
export const changeMeetingStatus = (id, status) => API.patch(`/interviews/update/${id}`, status); | |||
export const changeInterviewHiringStatus = (id, status) => API.patch(`/interviews/hiring/${id}`, status); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we will need another route. can try with /update/{id} route and check if it is working or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will work, but require changes in the update controller. So i don think we should do it now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. You can merge it.
No description provided.