Skip to content

Commit

Permalink
Merge branch 'master' i
Browse files Browse the repository at this point in the history
  • Loading branch information
sumathi-thirumani committed Oct 8, 2024
1 parent fb4a621 commit fd4025d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions backend/src/components/eas/eas.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ async function getAssessmentSessions(req, res) {
}

async function updateAssessmentSession(req, res) {
if (req.params.assessmentSessionID !== req.body.assessmentSessionID) {
if (req.params.sessionID !== req.body.sessionID) {
return res.status(HttpStatus.BAD_REQUEST).json({
message: 'The assessmentSessionID in the URL didn\'t match the assessmentSessionID in the request body.'
message: 'The sessionID in the URL didn\'t match the sessionID in the request body.'
});
}
try {
const userInfo = utils.getUser(req);
const payload = {
assessmentSessionID: req.body.assessmentSessionID,
sessionID: req.body.sessionID,
activeFromDate: req.body.activeFromDate,
activeUntilDate: req.body.activeUntilDate,
updateUser: userInfo.idir_username
};
const result = await utils.putData(`${config.get('server:eas:assessmentSessionsURL')}/${req.body.assessmentSessionID}`, payload, utils.getUser(req).idir_username);
const result = await utils.putData(`${config.get('server:eas:assessmentSessionsURL')}/${req.body.sessionID}`, payload, utils.getUser(req).idir_username);
return res.status(HttpStatus.OK).json(result);
} catch (e) {
logApiError(e, 'updateAssessmentSession', 'Error occurred while attempting to save the changes to the assessment session.');
Expand Down
2 changes: 1 addition & 1 deletion backend/src/routes/eas.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ const perm = require('../util/Permission');
const PERMISSION = perm.PERMISSION;

router.get('/assessment-sessions', passport.authenticate('jwt', {session: false}, undefined), permUtils.checkUserHasPermission(PERMISSION.MANAGE_EAS_SESSIONS_PERMISSION), extendSession, getAssessmentSessions);
router.put('/assessment-sessions/:assessmentSessionID', passport.authenticate('jwt', {session: false}, undefined), permUtils.checkUserHasPermission(PERMISSION.MANAGE_EAS_SESSIONS_PERMISSION), extendSession, updateAssessmentSession);
router.put('/assessment-sessions/:sessionID', passport.authenticate('jwt', {session: false}, undefined), permUtils.checkUserHasPermission(PERMISSION.MANAGE_EAS_SESSIONS_PERMISSION), extendSession, updateAssessmentSession);

module.exports = router;
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default {
this.processing = true;
await this.validateForm();
ApiService.apiAxios
.put(`${Routes.eas.GET_ASSESSMENT_SESSIONS}`+'/'+this.editSession.assessmentSessionID, this.editSession)
.put(`${Routes.eas.GET_ASSESSMENT_SESSIONS}`+'/'+this.editSession.sessionID, this.editSession)
.then(() => {
this.setSuccessAlert(
'Success! The assessment session has been updated.'
Expand Down

0 comments on commit fd4025d

Please sign in to comment.