From c27174a50cff03d9e10c8e55c360a4d74e9eaa1d Mon Sep 17 00:00:00 2001 From: Le Date: Thu, 17 Oct 2024 12:04:58 -0700 Subject: [PATCH 1/2] bug fix - unable load declaration to submit application --- frontend/src/store/summaryDeclaration.js | 27 ++++++++++++------------ 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/frontend/src/store/summaryDeclaration.js b/frontend/src/store/summaryDeclaration.js index a52f227ed..664037981 100644 --- a/frontend/src/store/summaryDeclaration.js +++ b/frontend/src/store/summaryDeclaration.js @@ -1,15 +1,14 @@ import { defineStore } from 'pinia'; -import { useAppStore } from './app.js'; -import { useApplicationStore } from './application.js'; -import { useAuthStore } from './auth.js'; -import { useNavBarStore } from './navBar.js'; -import { useReportChangesStore } from './reportChanges.js'; - -import ApiService from '../common/apiService.js'; -import { ApiRoutes } from '../utils/constants.js'; -import { checkSession } from '../utils/session.js'; -import { CHANGE_REQUEST_TYPES } from '../utils/constants.js'; +import ApiService from '@/common/apiService.js'; +import { useAppStore } from '@/store/app.js'; +import { useApplicationStore } from '@/store/application.js'; +import { useAuthStore } from '@/store/auth.js'; +import { useNavBarStore } from '@/store/navBar.js'; +import { useReportChangesStore } from '@/store/reportChanges.js'; +import { ApiRoutes } from '@/utils/constants.js'; +import { CHANGE_REQUEST_TYPES } from '@/utils/constants.js'; +import { checkSession } from '@/utils/session.js'; function parseLicenseCategories(licenseCategories) { const appStore = useAppStore(); @@ -102,7 +101,7 @@ export const useSummaryDeclarationStore = defineStore('summaryDeclaration', { payload.agreeConsentCertify = null; payload.orgContactName = null; } - this.model(payload); + this.setModel(payload); } catch (error) { console.log(`Failed to get Declaration - ${error}`); throw error; @@ -117,7 +116,7 @@ export const useSummaryDeclarationStore = defineStore('summaryDeclaration', { payload.agreeConsentCertify = null; payload.orgContactName = null; } - this.model(payload); + this.setModel(payload); } catch (error) { console.log(`Failed to get Declaration - ${error}`); throw error; @@ -149,7 +148,7 @@ export const useSummaryDeclarationStore = defineStore('summaryDeclaration', { let response = await ApiService.apiAxios.patch(ApiRoutes.CHANGE_REQUEST + '/' + changeRequestId, payload); this.model.externalStatus = 'SUBMITTED'; - this.model(this.model); + this.setModel(this.model); reportChangesStore.updateExternalStatusInChangeRequestStore({ changeRequestId: changeRequestId, newStatus: 2, @@ -341,7 +340,7 @@ export const useSummaryDeclarationStore = defineStore('summaryDeclaration', { declarationAStatus: payload?.declarationAStatus, declarationBStatus: payload?.declarationBStatus, }; - this.model(declarationModel); + this.setModel(declarationModel); // Load Summary model let summaryModel = { From 1ceee99edb1f6b4bafa0da169f725c523babfcef Mon Sep 17 00:00:00 2001 From: Le Date: Thu, 17 Oct 2024 12:43:41 -0700 Subject: [PATCH 2/2] minor clean up --- frontend/src/store/summaryDeclaration.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/src/store/summaryDeclaration.js b/frontend/src/store/summaryDeclaration.js index 664037981..3e3846ee3 100644 --- a/frontend/src/store/summaryDeclaration.js +++ b/frontend/src/store/summaryDeclaration.js @@ -6,8 +6,7 @@ import { useApplicationStore } from '@/store/application.js'; import { useAuthStore } from '@/store/auth.js'; import { useNavBarStore } from '@/store/navBar.js'; import { useReportChangesStore } from '@/store/reportChanges.js'; -import { ApiRoutes } from '@/utils/constants.js'; -import { CHANGE_REQUEST_TYPES } from '@/utils/constants.js'; +import { ApiRoutes, CHANGE_REQUEST_TYPES } from '@/utils/constants.js'; import { checkSession } from '@/utils/session.js'; function parseLicenseCategories(licenseCategories) {