Skip to content

Commit

Permalink
Merge pull request #373 from awslabs/meaisiah-file-fix
Browse files Browse the repository at this point in the history
Fix file upload iteration
  • Loading branch information
amazon-meaisiah authored Mar 31, 2020
2 parents d12c3ab + 25609ba commit 3aef3a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dev-portal/src/pages/Admin/ApiManagement.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const ApiManagement = observer(class ApiManagement extends React.Componen

if (files.length > 0) {
this.setState(prev => ({ ...prev, errors: [] }))
files.forEach(file => {
;[].forEach.call(files, file => {
const reader = new window.FileReader()

reader.onload = (e) => {
Expand All @@ -106,7 +106,7 @@ export const ApiManagement = observer(class ApiManagement extends React.Componen
.then((app) => app.post('/admin/catalog/visibility', {}, { swagger }, {}))
.then((res) => {
if (res.status === 200) {
this.setState(prev => ({ ...prev, modalOpen: anyFailures, errors: anyFailures ? prev.errors : [] }))
this.setState(prev => ({ ...prev, modalOpen: Boolean(anyFailures), errors: anyFailures ? prev.errors : [] }))
}
setTimeout(() => this.getApiVisibility(), 2000)
})
Expand Down

0 comments on commit 3aef3a5

Please sign in to comment.