Skip to content

Commit

Permalink
Merge pull request #87 from cfpb/meissadia/ie-entries-error
Browse files Browse the repository at this point in the history
Replace use of Object.entries()
  • Loading branch information
BarakStout authored Dec 20, 2019
2 parents 6a2f9c0 + 330e52a commit d85455f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/filing/submission/parseErrors/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,25 +133,26 @@ class ParseErrors extends Component {
function errorResponseParser(errorResponse, uliNeeded) {
let apiErrorMessages = []

errorResponse.forEach(function(errorsFound,i) {
if(errorsFound && errorsFound.errorMessages) {
for (const [index, errorMessage] of errorsFound.errorMessages.entries()) {
errorResponse.forEach(function (errorsFound, i) {
if (errorsFound && errorsFound.errorMessages) {
errorsFound.errorMessages.forEach(function (errorMessage, index) {
let inputContent = errorMessage.inputValue

if (errorMessage.inputValue === '') inputContent = <em>(blank)</em>

apiErrorMessages.push(
<tr key={`${i}${index}`}>
<td>{errorsFound.rowNumber}</td>
{uliNeeded ? <td>{errorsFound.estimatedULI}</td>:null}
{uliNeeded ? <td>{errorsFound.estimatedULI}</td> : null}
<td>{errorMessage.fieldName}</td>
<td>{inputContent}</td>
<td>{errorMessage.validValues}</td>
</tr>
<td> {errorMessage.validValues}</td>
</tr>
)
}
})
}
})

return apiErrorMessages
}

Expand Down

0 comments on commit d85455f

Please sign in to comment.