@brightleaf/react-hooks
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -61,9 +61,19 @@ "use strict"; | ||
const resp = await fetch(urlToFetch, config); | ||
const result = await resp.json(); | ||
if (result && result.data) { | ||
if (config.headers['Content-Type'] === 'application/json') { | ||
const result = await resp.json(); | ||
if (result && result.data) { | ||
return dispatch({ | ||
type: 'success', | ||
payload: { | ||
data: result.data | ||
} | ||
}); | ||
} | ||
return dispatch({ | ||
type: 'success', | ||
payload: { | ||
data: result.data | ||
data: result | ||
} | ||
@@ -73,2 +83,3 @@ }); | ||
const result = await resp.text(); | ||
return dispatch({ | ||
@@ -75,0 +86,0 @@ type: 'success', |
{ | ||
"name": "@brightleaf/react-hooks", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "Useful react hooks", | ||
@@ -5,0 +5,0 @@ "files": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55045
1480