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() {
6565 response
6666 . then ( lrdDocsJson => lrdDocsJson . json ( ) )
6767 . then ( ( lrdDocsJson ) => {
68+ // check if not an array
69+ if ( ! Array . isArray ( lrdDocsJson ) ) {
70+ setError ( "Invalid response" )
71+ setSendingRequest ( false )
72+ return
73+ }
6874 setError ( null )
6975 setLrdDocsJson ( lrdDocsJson )
7076 setLrdDocsJsonCopy ( lrdDocsJson )
Original file line number Diff line number Diff line change @@ -95,13 +95,15 @@ export default function ApiActionRequest(props: Props) {
9595 < div className = "collapse-title text-sm text-slate-500 pl-0" >
9696 Set Global Headers
9797 </ 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+ ) }
105107 < div className = "collapse-content p-0" >
106108 < AceEditor
107109 height = '200px'
You can’t perform that action at this time.
0 commit comments