diff --git a/src/applications/edu-benefits/10282/config/form.js b/src/applications/edu-benefits/10282/config/form.js index 9bc3eb885990..ac8e0153f0c7 100644 --- a/src/applications/edu-benefits/10282/config/form.js +++ b/src/applications/edu-benefits/10282/config/form.js @@ -1,6 +1,7 @@ import React from 'react'; import { VA_FORM_IDS } from 'platform/forms/constants'; import FormFooter from 'platform/forms/components/FormFooter'; +import environment from 'platform/utilities/environment'; import { fullNameNoSuffixUI, fullNameNoSuffixSchema, @@ -23,7 +24,7 @@ import { techIndustryFocusArea, } from '../pages'; import StatementOfTruth from '../components/StatementOfTruth'; -// import submitForm from './submitForm'; +import submitForm from './submitForm'; import { transform } from './submit-transformer'; import FormHelp from '../components/FormHelp'; import IntroductionPage from '../containers/IntroductionPage'; @@ -31,12 +32,8 @@ import IntroductionPage from '../containers/IntroductionPage'; const formConfig = { rootUrl: manifest.rootUrl, urlPrefix: '/', - // submitUrl: '/v0/api', - submit: async formData => { - return new Promise(resolve => { - resolve({ status: 201, data: formData }); - }); - }, + submitUrl: `${environment.API_URL}/v0/education_benefits_claims/10282`, + submit: submitForm, trackingPrefix: 'edu-10282-', introduction: IntroductionPage, confirmation: ConfirmationPage, diff --git a/src/applications/edu-benefits/10282/config/submit-transformer.js b/src/applications/edu-benefits/10282/config/submit-transformer.js index 47ddffc9dd75..ccee12d4a9a5 100644 --- a/src/applications/edu-benefits/10282/config/submit-transformer.js +++ b/src/applications/edu-benefits/10282/config/submit-transformer.js @@ -1,7 +1,12 @@ +import _ from 'lodash'; + export function transform(formConfig, form) { + const newForm = _.cloneDeep(form.data); + delete newForm.AGREED; + delete newForm.signature; return JSON.stringify({ educationBenefitsClaim: { - form: JSON.stringify(form.data), + form: JSON.stringify(newForm), }, }); } diff --git a/src/applications/edu-benefits/10282/tests/fixtures/data/transformedData.js b/src/applications/edu-benefits/10282/tests/fixtures/data/transformedData.js index 1f9520bd1c46..c66897c99037 100644 --- a/src/applications/edu-benefits/10282/tests/fixtures/data/transformedData.js +++ b/src/applications/edu-benefits/10282/tests/fixtures/data/transformedData.js @@ -10,8 +10,8 @@ const transformedMinimalDataActual = { last: 'Doe', }, highestLevelOfEducation: {}, - signature: 'Jane Doe', - AGREED: true, + // signature: 'Jane Doe', + // AGREED: true, }; export const transformedMinimalData = JSON.stringify({