File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -36,12 +36,11 @@ export function useFetch(arg1, arg2) {
3636
3737 const fetchData = useCallback ( method => async ( fArg1 , fArg2 ) => {
3838 let query = ''
39- const fetchOptions = { }
4039 if ( isObject ( fArg1 ) && method . toLowerCase ( ) !== 'get' ) {
41- fetchOptions . body = JSON . stringify ( fArg1 )
40+ options . body = JSON . stringify ( fArg1 )
4241 } else if ( baseUrl && typeof fArg1 === 'string' ) {
4342 url = baseUrl + fArg1
44- if ( isObject ( fArg2 ) ) fetchOptions . body = JSON . stringify ( fArg2 )
43+ if ( isObject ( fArg2 ) ) options . body = JSON . stringify ( fArg2 )
4544 }
4645 if ( typeof fArg1 === 'string' && typeof fArg2 === 'string' ) query = fArg2
4746
@@ -50,7 +49,6 @@ export function useFetch(arg1, arg2) {
5049 const response = await fetch ( url + query , {
5150 method,
5251 ...options ,
53- ...fetchOptions
5452 } )
5553 let data = null
5654 try {
You can’t perform that action at this time.
0 commit comments