Skip to content

Commit

Permalink
Fix file upload
Browse files Browse the repository at this point in the history
  • Loading branch information
amazon-meaisiah committed Mar 26, 2020
1 parent b111305 commit 347cb5b
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 347cb5b

Please sign in to comment.