all apparently working and cleaned up

This commit is contained in:
2020-06-10 21:40:05 +00:00
parent 0a43e53ab7
commit 3dd7e05549
9 changed files with 12 additions and 985 deletions

View File

@@ -198,7 +198,6 @@ export default {
if (!contentType) {
return response;
}
//console.log("gzapi::extractBody method, content type is:", contentType);
if (contentType.includes("json")) {
return await response.json();
}
@@ -216,7 +215,6 @@ export default {
if (!contentType) {
return response;
}
//console.log("gzapi::extractBody method, content type is:", contentType);
if (contentType.includes("json")) {
return response.json();
}
@@ -442,9 +440,7 @@ export default {
//
async upsertEx(route, data) {
try {
console.log("gzapi:upsertEx TOP");
let that = this;
// return new Promise(function upsertDataToServer(resolve, reject) {
//determine if this is a new or existing record
let fetchOptions = undefined;
if (data.concurrency) {
@@ -458,28 +454,13 @@ export default {
route = route.slice(0, -2);
}
}
// console.log("** gzapi:upsertEx calling test delay");
// await this.doDelayAsync();
// console.log("** gzapi:upsertEx back from delay continuing..");
console.log("gzapi:upsertEx calling fetch");
let r = await fetch(that.APIUrl(route), fetchOptions);
console.log("gzapi:upsertEx calling statusEx");
that.statusEx(r);
console.log("gzapi:upsertEx calling extractBodyEx");
r = await that.extractBodyEx(r);
console.log("gzapi:upsertEx done, returning response");
return r;
// eslint-disable-next-line
// .then((response) => {
// //Note: response.error indicates there is an error, however this is not an unusual condition
// //it could be validation errors or other general error so we need to treat it here like it's normal
// //and let the caller deal with it appropriately
// resolve(response);
// })
} catch (error) {
handleError("UPSERT", error, route, reject);
}
// });
},
upsert(route, data) {
let that = this;