-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PAF-74 Allow attachment URLs into SQS payload
* Altered conditionals stopping 'image' array from being added to payload * Fixed a typo * Removed an unnecessary log
- Loading branch information
1 parent
8300f84
commit 424f72d
Showing
1 changed file
with
3 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,12 +7,12 @@ const valuesMap = require('./ims-hof-values-map.json'); | |
const eform = { | ||
EformFields: [], | ||
AdditionalPeople: [], | ||
Attachements: [] | ||
Attachments: [] | ||
}; | ||
|
||
const addFieldToEform = (fieldName, fieldValue) => { | ||
if (fieldName === 'images') { | ||
eform.Attachements.push({url: fieldValue}); | ||
eform.Attachments = fieldValue; | ||
} else if (fieldName === 'txpermoreallholder') { | ||
eform.AdditionalPeople.push({FieldName: fieldName, FieldValue: fieldValue}); | ||
} else { | ||
|
@@ -31,7 +31,6 @@ const addField = (name, value) => { | |
} | ||
} | ||
if (name === 'images') { | ||
console.log('Value :: ', value); | ||
addFieldToEform(name, value); | ||
} | ||
}; | ||
|
@@ -43,7 +42,7 @@ const addGroup = value => { | |
const addAllegationData = data => { | ||
Object.entries(data).forEach(entry => { | ||
const [key, value] = entry; | ||
if (value !== '' && key !== 'images') { | ||
if (value !== '') { | ||
if (key.includes('group')) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jamiecarterHO
Author
Contributor
|
||
const groups = Array.isArray(value) ? value : value.split(','); | ||
groups.map(addGroup); | ||
|
is it possible to add the if statement in one line if(value !== '' && key.includes('group'))