File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,12 @@ export default function App() {
65
65
response
66
66
. then ( lrdDocsJson => lrdDocsJson . json ( ) )
67
67
. then ( ( lrdDocsJson ) => {
68
+ // check if not an array
69
+ if ( ! Array . isArray ( lrdDocsJson ) ) {
70
+ setError ( "Invalid response" )
71
+ setSendingRequest ( false )
72
+ return
73
+ }
68
74
setError ( null )
69
75
setLrdDocsJson ( lrdDocsJson )
70
76
setLrdDocsJsonCopy ( lrdDocsJson )
Original file line number Diff line number Diff line change @@ -95,13 +95,15 @@ export default function ApiActionRequest(props: Props) {
95
95
< div className = "collapse-title text-sm text-slate-500 pl-0" >
96
96
Set Global Headers
97
97
</ div >
98
- < div className = 'text-sm text-slate-500 p-0' >
99
- < ExclamationTriangleIcon className = 'inline-block w-4 h-4 ml-1 text-yellow-500' />
100
- This request requires a file upload. < br />
101
- < LockOpenIcon className = 'inline-block w-4 h-4 ml-1 text-slate-500' />
102
- Global headers will be overridden as < code > application/json</ code > ⇢ < code > multipart/form-data</ code >
103
- < br />
104
- </ div >
98
+ { ( files . length != 0 && ( method == 'POST' || method == 'PUT' || method == 'DELETE' ) ) && (
99
+ < div className = 'text-sm text-slate-500 p-0' >
100
+ < ExclamationTriangleIcon className = 'inline-block w-4 h-4 ml-1 text-yellow-500' />
101
+ This request requires a file upload. < br />
102
+ < LockOpenIcon className = 'inline-block w-4 h-4 ml-1 text-slate-500' />
103
+ Global headers will be overridden as < code > application/json</ code > ⇢ < code > multipart/form-data</ code >
104
+ < br />
105
+ </ div >
106
+ ) }
105
107
< div className = "collapse-content p-0" >
106
108
< AceEditor
107
109
height = '200px'
You can’t perform that action at this time.
0 commit comments