Commit 485cd218 authored by AravindR-K's avatar AravindR-K

Fix : Interview not creating bug fixed

parent db700d73
...@@ -27,14 +27,10 @@ router.post('/', authorize('admin', 'hr', 'pm'), async (req, res) => { ...@@ -27,14 +27,10 @@ router.post('/', authorize('admin', 'hr', 'pm'), async (req, res) => {
return res.status(400).json({ message: 'Candidate and position are required' }); return res.status(400).json({ message: 'Candidate and position are required' });
} }
// Validate candidate exists and is a candidate // Validate candidate exists
const candidate = await User.findById(candidateId); const candidate = await User.findById(candidateId);
if (!candidate) return res.status(404).json({ message: 'Candidate not found' }); if (!candidate) return res.status(404).json({ message: 'Candidate not found' });
// Validate interviewer exists
const interviewer = await User.findById(interviewerId);
if (!interviewer) return res.status(404).json({ message: 'Interviewer not found' });
// Build quiz array if quiz IDs provided // Build quiz array if quiz IDs provided
let quizzes = []; let quizzes = [];
if (quizIds && quizIds.length > 0) { if (quizIds && quizIds.length > 0) {
......
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
<table class="history-table"> <table class="history-table">
<thead> <thead>
<tr> <tr>
<th>#</th> <th>Interview ID</th>
<th>Position</th> <th>Position</th>
<th>Interviewer</th> <th>Interviewer</th>
<th>Quizzes</th> <th>Quizzes</th>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment