diff --git a/frontend/src/components/housing/enquiry/EnquiryIntakeForm.vue b/frontend/src/components/housing/enquiry/EnquiryIntakeForm.vue index 0fb5362d..b776ea1d 100644 --- a/frontend/src/components/housing/enquiry/EnquiryIntakeForm.vue +++ b/frontend/src/components/housing/enquiry/EnquiryIntakeForm.vue @@ -18,7 +18,6 @@ import { FormAutosave } from '@/components/form'; import CollectionDisclaimer from '@/components/housing/CollectionDisclaimer.vue'; -import EnquiryIntakeConfirmation from '@/components/housing/enquiry/EnquiryIntakeConfirmation.vue'; import { Button, Card, Divider, useConfirm, useToast } from '@/lib/primevue'; import { enquiryService, submissionService } from '@/services'; import { useConfigStore } from '@/store'; @@ -41,7 +40,6 @@ const { enquiryId = undefined } = defineProps<{ const { getConfig } = storeToRefs(useConfigStore()); // State -const assignedActivityId: Ref = ref(undefined); const autoSaveRef: Ref | null> = ref(null); const editable: Ref = ref(true); const filteredProjectActivityIds: Ref> = ref([]); @@ -117,7 +115,7 @@ async function confirmNext(data: any) { function confirmSubmit(data: any) { confirm.require({ - message: 'Are you sure you wish to submit this form? Please review the form before submitting.', + message: 'Are you sure you wish to submit this form?', header: 'Please confirm submission', acceptLabel: 'Confirm', rejectLabel: 'Cancel', @@ -253,21 +251,19 @@ async function onSubmit(data: any) { enquiryResponse = await enquiryService.submitDraft(data); if (enquiryResponse.data.activityId && enquiryResponse.data.enquiryId) { - assignedActivityId.value = enquiryResponse.data.activityId; formRef.value?.setFieldValue('activityId', enquiryResponse.data.activityId); formRef.value?.setFieldValue('enquiryId', enquiryResponse.data.enquiryId); - // Update route query for refreshing - router.replace({ - name: RouteName.HOUSING_ENQUIRY_INTAKE, + // Send confirmation email + emailConfirmation(enquiryResponse.data.activityId, enquiryResponse.data.enquiryId); + + router.push({ + name: RouteName.HOUSING_ENQUIRY_CONFIRMATION, query: { activityId: enquiryResponse.data.activityId, enquiryId: enquiryResponse.data.enquiryId } }); - - // Send confirmation email - emailConfirmation(enquiryResponse.data.activityId, enquiryResponse.data.enquiryId); } else { throw new Error('Failed to retrieve correct enquiry draft data'); } @@ -296,7 +292,7 @@ onBeforeMount(async () => { diff --git a/frontend/src/components/housing/submission/SubmissionAssistance.vue b/frontend/src/components/housing/submission/SubmissionAssistance.vue index d534d819..9c30c76c 100644 --- a/frontend/src/components/housing/submission/SubmissionAssistance.vue +++ b/frontend/src/components/housing/submission/SubmissionAssistance.vue @@ -43,7 +43,7 @@ const checkApplicantValuesValid = ( const confirmSubmit = () => { confirm.require({ - message: 'Are you sure you want to request assistance for this form? Please review this form before submitting.', + message: 'Are you sure you want to request assistance for this form?', header: 'Please confirm assistance', acceptLabel: 'Confirm', rejectLabel: 'Cancel', diff --git a/frontend/src/components/housing/submission/SubmissionIntakeConfirmation.vue b/frontend/src/components/housing/submission/SubmissionIntakeConfirmation.vue deleted file mode 100644 index 2b44bc09..00000000 --- a/frontend/src/components/housing/submission/SubmissionIntakeConfirmation.vue +++ /dev/null @@ -1,29 +0,0 @@ - - - diff --git a/frontend/src/components/housing/submission/SubmissionIntakeForm.vue b/frontend/src/components/housing/submission/SubmissionIntakeForm.vue index 843c7157..bdd32176 100644 --- a/frontend/src/components/housing/submission/SubmissionIntakeForm.vue +++ b/frontend/src/components/housing/submission/SubmissionIntakeForm.vue @@ -26,7 +26,6 @@ import { import CollectionDisclaimer from '@/components/housing/CollectionDisclaimer.vue'; import IntakeAssistanceConfirmation from './IntakeAssistanceConfirmation.vue'; import SubmissionAssistance from '@/components/housing/submission/SubmissionAssistance.vue'; -import SubmissionIntakeConfirmation from '@/components/housing/submission/SubmissionIntakeConfirmation.vue'; import { submissionIntakeSchema } from '@/components/housing/submission/SubmissionIntakeSchema'; import { Accordion, @@ -102,6 +101,7 @@ const activeStep: Ref = ref(0); const addressGeocoderOptions: Ref> = ref([]); const assignedActivityId: Ref = ref(undefined); const assistanceAssignedActivityId: Ref = ref(undefined); +const assistanceAssignedEnquiryId: Ref = ref(undefined); const autoSaveRef: Ref | null> = ref(null); const editable: Ref = ref(true); const formRef: Ref | null> = ref(null); @@ -143,7 +143,7 @@ function confirmSubmit(data: any) { const submitData: Submission = omit(data as SubmissionForm, ['addressSearch']); confirm.require({ - message: 'Are you sure you wish to submit this form? Please review the form before submitting.', + message: 'Are you sure you wish to submit this form?', header: 'Please confirm submission', acceptLabel: 'Confirm', rejectLabel: 'Cancel', @@ -201,6 +201,7 @@ async function handleEnquirySubmit(values: any, relatedActivityId: string) { if (enquiryResponse.data.activityId) { toast.success('Form saved'); assistanceAssignedActivityId.value = enquiryResponse.data.activityId; + assistanceAssignedEnquiryId.value = enquiryResponse.data.enquiryId; // Send confirmation email emailConfirmation(enquiryResponse.data.activityId, enquiryResponse.data.submissionId); @@ -354,17 +355,16 @@ async function onSubmit(data: any) { if (response.data.activityId && response.data.submissionId) { assignedActivityId.value = response.data.activityId; - // Update route query for refreshing - router.replace({ - name: RouteName.HOUSING_SUBMISSION_INTAKE, + // Send confirmation email + emailConfirmation(response.data.activityId, response.data.submissionId); + + router.push({ + name: RouteName.HOUSING_SUBMISSION_CONFIRMATION, query: { activityId: response.data.activityId, submissionId: response.data.submissionId } }); - - // Send confirmation email - emailConfirmation(response.data.activityId, response.data.submissionId); } else { throw new Error('Failed to retrieve correct draft data'); } @@ -759,7 +759,7 @@ onBeforeMount(async () => {