diff --git a/backend/src/routes/changeRequest.js b/backend/src/routes/changeRequest.js index 522f89fe..132bdd86 100644 --- a/backend/src/routes/changeRequest.js +++ b/backend/src/routes/changeRequest.js @@ -45,7 +45,7 @@ router.get('/:changeRequestId', passport.authenticate('jwt', {session: false}),i * Update Change Request */ -router.patch('/:changeRequestId', //passport.authenticate('jwt', {session: false}),isValidBackendToken, +router.patch('/:changeRequestId', passport.authenticate('jwt', {session: false}),isValidBackendToken, [param('changeRequestId', 'URL param: [changeRequestId] is required').not().isEmpty()], (req, res) => { validationResult(req).throw(); return updateChangeRequest(req, res); @@ -143,11 +143,11 @@ router.delete('/mtfi/:mtfiId/', passport.authenticate('jwt', {session: false}),i }); - /** +/** * Update Change Request MTFI */ -router.patch('/mtfi/:mtfiId/', //passport.authenticate('jwt', {session: false}),isValidBackendToken, +router.patch('/mtfi/:mtfiId/', passport.authenticate('jwt', {session: false}),isValidBackendToken, [param('mtfiId', 'URL param: [mtfiId] is required').not().isEmpty()], (req, res) => { validationResult(req).throw(); return updateChangeRequestMTFI(req, res); diff --git a/backend/src/routes/facility.js b/backend/src/routes/facility.js index d18214f5..a20f170a 100644 --- a/backend/src/routes/facility.js +++ b/backend/src/routes/facility.js @@ -49,7 +49,7 @@ router.get('/ccfri/:ccfriId', passport.authenticate('jwt', {session: false}),isV * Get Parent Fees for a facility * */ -router.get('/fees/:facilityId/year/:programYearId', // passport.authenticate('jwt', {session: false}),isValidBackendToken, +router.get('/fees/:facilityId/year/:programYearId', passport.authenticate('jwt', {session: false}),isValidBackendToken, [param('facilityId', 'URL param: [facilityId] is required').not().isEmpty(), param('programYearId', 'URL param: [programYearId] is required').not().isEmpty()], (req, res) => { validationResult(req).throw(); diff --git a/frontend/src/components/mtfi/CurrentFeeVerification.vue b/frontend/src/components/mtfi/CurrentFeeVerification.vue index 700cf48a..d7c3ec8a 100644 --- a/frontend/src/components/mtfi/CurrentFeeVerification.vue +++ b/frontend/src/components/mtfi/CurrentFeeVerification.vue @@ -596,7 +596,10 @@ export default { }, async next() { // this.rfi3percentCategories = await this.getCcfriOver3percent(this.currentPcfCcfri); - + if (!this.isReadOnly && !this.loading) { + this.$store.commit('ccfriApp/model', this.model); + await this.save(false); + } //always check for RFI regardless of new or renewal state this.rfi3percentCategories = await this.getCcfriOver3percent(this.currentPcfCcfri); console.log('rfi3percentCategories length ', this.rfi3percentCategories.length); @@ -651,10 +654,6 @@ export default { //this.model = this.$store.state.ccfriApp.model ?? model; }, async beforeRouteLeave(_to, _from, next) { - if (!this.isReadOnly && !this.loading) { - this.$store.commit('ccfriApp/model', this.model); - this.save(false); - } next(); }, components: {NavButton} diff --git a/frontend/src/components/requestChanges/ReportChanges.vue b/frontend/src/components/requestChanges/ReportChanges.vue index 7dc39bca..31b1564d 100644 --- a/frontend/src/components/requestChanges/ReportChanges.vue +++ b/frontend/src/components/requestChanges/ReportChanges.vue @@ -352,10 +352,11 @@ export default { //change in backend, only returns 1 at a time rn let action = changeActions.find(el => el.changeType == "NEW_FACILITY"); - if (action.facilities) { + if (action?.facilities) { action.facilities.forEach(fac => { - if (fac.facilityName){ - str = str + `${fac.facilityName}, `; + const facilityUserProfileList = this.userProfileList?.find(item => item.facilityId === fac.facilityId); + if (facilityUserProfileList?.facilityName) { + str = str + `${facilityUserProfileList?.facilityName}, `; } }); } diff --git a/frontend/src/components/util/NavBar.vue b/frontend/src/components/util/NavBar.vue index 932a1214..80ec4cad 100644 --- a/frontend/src/components/util/NavBar.vue +++ b/frontend/src/components/util/NavBar.vue @@ -119,7 +119,7 @@ export default { ...mapGetters('navBar', ['isChangeRequest']), ...mapGetters('auth', ['userInfo']), ...mapGetters('reportChanges', ['isCREceweComplete', 'isCRLicenseComplete', 'changeRequestStatus', 'getChangeNotificationActionId', 'isChangeNotificationFormComplete']), - ...mapState('reportChanges',['mtfiFacilities']), + ...mapState('reportChanges',['mtfiFacilities','userProfileChangeRequests','changeRequestId']), ...mapGetters('ccfriApp', ['getCCFRIById']), navRefresh() { return this.$route.name + this.$route.params.urlGuid; @@ -215,7 +215,8 @@ export default { let checkbox; //true will show checkmark, false will not let linkName; if (this.isChangeRequest) { - checkbox = this.changeRequestStatus === 'SUBMITTED' && !this.unlockDeclaration; + const currentCR = this.userProfileChangeRequests.find(item => item.changeRequestId === this.changeRequestId); + checkbox = this.changeRequestStatus === 'SUBMITTED' && !currentCR?.unlockDeclaration; if(this.changeType===CHANGE_TYPES.NEW_FACILITY){ linkName = 'Summary and Declaration New Facility'; } diff --git a/frontend/src/store/modules/summaryDeclaration.js b/frontend/src/store/modules/summaryDeclaration.js index d875cb12..6ec3aedc 100644 --- a/frontend/src/store/modules/summaryDeclaration.js +++ b/frontend/src/store/modules/summaryDeclaration.js @@ -76,6 +76,10 @@ export default { checkSession(); try { let payload = (await ApiService.apiAxios.get(ApiRoutes.APPLICATION_DECLARATION + '/' + rootState.application.applicationId)).data; + if (payload && rootState.application.unlockDeclaration) { + payload.agreeConsentCertify = null; + payload.orgContactName = null; + } commit('model', payload); } catch (error) { console.log(`Failed to get Declaration - ${error}`);