react-native-woocommerce-api
Advanced tools
Comparing version 1.7.0 to 1.8.0
@@ -214,3 +214,2 @@ 'use strict'; | ||
//console.log(requestUrl); | ||
return fetch(requestUrl, { | ||
@@ -220,3 +219,3 @@ headers: { | ||
}, | ||
}).then((response) => response.json()); | ||
}).then((response) => !data.hasOwnProperty('header') && !data.header ? response.json() : response.json().then(data => ({header: response.headers, data: data}))); | ||
} else { | ||
@@ -231,3 +230,3 @@ return fetch(requestUrl, { | ||
body: JSON.stringify(data), | ||
}).then((response) => response.json()); | ||
}).then((response) => !data.hasOwnProperty('header') && !data.header ? response.json() : response.json().then(data => ({header: response.headers, data: data}))); | ||
} | ||
@@ -234,0 +233,0 @@ }; |
{ | ||
"name": "react-native-woocommerce-api", | ||
"version": "1.7.0", | ||
"version": "1.8.0", | ||
"description": "Connects react Native to the WooCommerce API", | ||
@@ -5,0 +5,0 @@ "main": "lib/react-native-woocommerce-api.js", |
17948