Updates
This commit is contained in:
@@ -44,12 +44,12 @@ export default async function fetchApi<
|
|||||||
data = null;
|
data = null;
|
||||||
}
|
}
|
||||||
} else if (typeof options === "object") {
|
} else if (typeof options === "object") {
|
||||||
try {
|
|
||||||
let fetchData;
|
let fetchData;
|
||||||
let fetchOptions: RequestInit = {};
|
let fetchOptions: RequestInit = {};
|
||||||
|
|
||||||
|
try {
|
||||||
if (options.method.match(/post|put|delete|patch/i)) {
|
if (options.method.match(/post|put|delete|patch/i)) {
|
||||||
if (options.body && typeof options.body === "object") {
|
if (options.body && typeof options.body == "object") {
|
||||||
fetchOptions.body = JSON.stringify(options.body);
|
fetchOptions.body = JSON.stringify(options.body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -60,6 +60,8 @@ export default async function fetchApi<
|
|||||||
data = fetchData.json();
|
data = fetchData.json();
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.log("FetchAPI error #2:", error.message);
|
console.log("FetchAPI error #2:", error.message);
|
||||||
|
console.log("fetchData =>", fetchData);
|
||||||
|
console.log("fetchOptions =>", fetchOptions);
|
||||||
data = null;
|
data = null;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Vendored
+4
-2
@@ -49,11 +49,11 @@ function fetchApi(url, options) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (typeof options === "object") {
|
else if (typeof options === "object") {
|
||||||
try {
|
|
||||||
let fetchData;
|
let fetchData;
|
||||||
let fetchOptions = {};
|
let fetchOptions = {};
|
||||||
|
try {
|
||||||
if (options.method.match(/post|put|delete|patch/i)) {
|
if (options.method.match(/post|put|delete|patch/i)) {
|
||||||
if (options.body && typeof options.body === "object") {
|
if (options.body && typeof options.body == "object") {
|
||||||
fetchOptions.body = JSON.stringify(options.body);
|
fetchOptions.body = JSON.stringify(options.body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -63,6 +63,8 @@ function fetchApi(url, options) {
|
|||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
console.log("FetchAPI error #2:", error.message);
|
console.log("FetchAPI error #2:", error.message);
|
||||||
|
console.log("fetchData =>", fetchData);
|
||||||
|
console.log("fetchOptions =>", fetchOptions);
|
||||||
data = null;
|
data = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@moduletrace/datasquirel",
|
"name": "@moduletrace/datasquirel",
|
||||||
"version": "5.7.12",
|
"version": "5.7.13",
|
||||||
"description": "Cloud-based SQL data management tool",
|
"description": "Cloud-based SQL data management tool",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
|||||||
Reference in New Issue
Block a user