diff --git a/backend/src/components/eas/eas.js b/backend/src/components/eas/eas.js index f5bfbaab..6296f79b 100644 --- a/backend/src/components/eas/eas.js +++ b/backend/src/components/eas/eas.js @@ -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.'); diff --git a/backend/src/routes/eas.js b/backend/src/routes/eas.js index 768d4e63..11db8ee8 100644 --- a/backend/src/routes/eas.js +++ b/backend/src/routes/eas.js @@ -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; diff --git a/frontend/src/components/assessments/sessions/SessionEdit.vue b/frontend/src/components/assessments/sessions/SessionEdit.vue index f01c99a7..3c417001 100644 --- a/frontend/src/components/assessments/sessions/SessionEdit.vue +++ b/frontend/src/components/assessments/sessions/SessionEdit.vue @@ -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.'