Skip to content

Commit 3aef3a5

Browse files
author
amazon-meaisiah
authored
Merge pull request #373 from awslabs/meaisiah-file-fix
Fix file upload iteration
2 parents d12c3ab + 25609ba commit 3aef3a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dev-portal/src/pages/Admin/ApiManagement.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export const ApiManagement = observer(class ApiManagement extends React.Componen
8080

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

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

0 commit comments

Comments
 (0)