Skip to content

Commit

Permalink
Merge pull request #252 from Eastern-Research-Group/develop
Browse files Browse the repository at this point in the history
Sync staging with develop
  • Loading branch information
courtneymyers authored Nov 4, 2022
2 parents b9b6f73 + d5157b4 commit 46227a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 2 additions & 4 deletions app/client/src/routes/applicationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,16 @@ function ApplicationFormContent({ email }: { email: string }) {

getData(`${serverUrl}/api/formio-application-submission/${mongoId}`)
.then((res: FormioFetchedResponse) => {
if (!res.submission) return;

// set up s3 re-route to wrapper app
const s3Provider = Formio.Providers.providers.storage.s3;
Formio.Providers.providers.storage.s3 = function (formio: any) {
const s3Formio = cloneDeep(formio);
const comboKey = res.submission.data.bap_hidden_entity_combo_key;
const comboKey = res.submission?.data.bap_hidden_entity_combo_key;
s3Formio.formUrl = `${serverUrl}/api/s3/application/${mongoId}/${comboKey}`;
return s3Provider(s3Formio);
};

const data = { ...res.submission.data };
const data = { ...res.submission?.data };

// remove `ncesDataSource` and `ncesDataLookup` fields
if (data.hasOwnProperty("ncesDataSource")) delete data.ncesDataSource;
Expand Down
8 changes: 3 additions & 5 deletions app/client/src/routes/paymentRequestForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,17 @@ function PaymentRequestFormContent({ email }: { email: string }) {

getData(`${serverUrl}/api/formio-payment-request-submission/${rebateId}`)
.then((res: FormioFetchedResponse) => {
if (!res.submission) return;

// set up s3 re-route to wrapper app
const s3Provider = Formio.Providers.providers.storage.s3;
Formio.Providers.providers.storage.s3 = function (formio: any) {
const s3Formio = cloneDeep(formio);
const mongoId = res.submission._id;
const comboKey = res.submission.data.bap_hidden_entity_combo_key;
const mongoId = res.submission?._id;
const comboKey = res.submission?.data.bap_hidden_entity_combo_key;
s3Formio.formUrl = `${serverUrl}/api/s3/payment-request/${mongoId}/${comboKey}`;
return s3Provider(s3Formio);
};

const data = { ...res.submission.data };
const data = { ...res.submission?.data };

setStoredSubmissionData((_prevData) => {
storedSubmissionDataRef.current = cloneDeep(data);
Expand Down

0 comments on commit 46227a7

Please sign in to comment.