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) {
36
36
37
37
const fetchData = useCallback ( method => async ( fArg1 , fArg2 ) => {
38
38
let query = ''
39
- const fetchOptions = { }
40
39
if ( isObject ( fArg1 ) && method . toLowerCase ( ) !== 'get' ) {
41
- fetchOptions . body = JSON . stringify ( fArg1 )
40
+ options . body = JSON . stringify ( fArg1 )
42
41
} else if ( baseUrl && typeof fArg1 === 'string' ) {
43
42
url = baseUrl + fArg1
44
- if ( isObject ( fArg2 ) ) fetchOptions . body = JSON . stringify ( fArg2 )
43
+ if ( isObject ( fArg2 ) ) options . body = JSON . stringify ( fArg2 )
45
44
}
46
45
if ( typeof fArg1 === 'string' && typeof fArg2 === 'string' ) query = fArg2
47
46
@@ -50,7 +49,6 @@ export function useFetch(arg1, arg2) {
50
49
const response = await fetch ( url + query , {
51
50
method,
52
51
...options ,
53
- ...fetchOptions
54
52
} )
55
53
let data = null
56
54
try {
You can’t perform that action at this time.
0 commit comments