@symbolic/lib
Advanced tools
Comparing version 1.0.28 to 1.0.29
@@ -7,3 +7,2 @@ 'use strict'; | ||
var axios = _interopDefault(require('axios')); | ||
var _$1 = _interopDefault(require('lodash')); | ||
@@ -30,3 +29,25 @@ var Cookies = _interopDefault(require('js-cookie')); | ||
try { | ||
var response = await axios.post(url, body); | ||
var response = await fetch(url, { | ||
method: 'POST', | ||
headers: { | ||
Accept: 'application/json', | ||
'Content-Type': 'application/json' | ||
}, | ||
body: JSON.stringify(body) | ||
}); | ||
if (!response.ok) { | ||
if (shouldAlert && !isReactNative) { | ||
alert('Something went wrong'); | ||
} | ||
var responseText = await response.text(); | ||
console.log(responseText); | ||
throw new Error(responseText); | ||
} | ||
else { | ||
response = await response.json(); | ||
} | ||
} | ||
@@ -33,0 +54,0 @@ catch (error) { |
{ | ||
"name": "@symbolic/lib", | ||
"version": "1.0.28", | ||
"version": "1.0.29", | ||
"description": "plain js utilities", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -1,2 +0,1 @@ | ||
import axios from 'axios'; | ||
import _ from 'lodash'; | ||
@@ -23,3 +22,25 @@ import Cookies from 'js-cookie'; | ||
try { | ||
var response = await axios.post(url, body); | ||
var response = await fetch(url, { | ||
method: 'POST', | ||
headers: { | ||
Accept: 'application/json', | ||
'Content-Type': 'application/json' | ||
}, | ||
body: JSON.stringify(body) | ||
}); | ||
if (!response.ok) { | ||
if (shouldAlert && !isReactNative) { | ||
alert('Something went wrong'); | ||
} | ||
var responseText = await response.text(); | ||
console.log(responseText); | ||
throw new Error(responseText); | ||
} | ||
else { | ||
response = await response.json(); | ||
} | ||
} | ||
@@ -26,0 +47,0 @@ catch (error) { |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
16465
445
2