Skip to content

Commit

Permalink
Merge pull request #34 from EmTanIT/khoaBE
Browse files Browse the repository at this point in the history
Update examPhase
  • Loading branch information
bentran1vn committed Oct 6, 2023
2 parents 37db45d + cbef41f commit b1c1d7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions routes/examPhase.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ router.post('/', async (req, res) => {

router.put('/', async (req, res) => { // Update ExamPhase
const examPhaseUp = req.body
const id = parseInt(examPhaseUp.id)
const id = parseInt(examPhaseUp.examPhaseId)

try {
const check = await ExamPhase.update(examPhaseUp, {
Expand All @@ -59,13 +59,13 @@ router.put('/', async (req, res) => { // Update ExamPhase
}
})
if (check[0] === 0) {
res.json(NotFoundResponse())
res.json(MessageResponse("ExamPhase Update !"))
} else {
res.json(MessageResponse('Exam Phase updated'))
res.status(500).json({ error: 'Internal Server Error' });
}
} catch (error) {
console.log(error)
res.json(MessageResponse('Error found'))
res.status(500).json({ error: 'Internal Server Error' });
}
})

Expand Down Expand Up @@ -104,11 +104,11 @@ router.put('/updatePhase', async (req, res) => {
}
}
)
if(result){
if (result) {
res.json(MessageResponse("ExamPhase Update !"))
} else {
res.status(500).json({ error: 'Internal Server Error' });
}
}
} catch (error) {
res.status(500).json({ error: 'Internal Server Error' });
}
Expand Down
2 changes: 1 addition & 1 deletion routes/student.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ router.post('/create', async (req, res) => {
} catch (err) {
console.log(err)
res.json(InternalErrResponse());
}
}
})

export default router
Expand Down

0 comments on commit b1c1d7e

Please sign in to comment.