This commit is contained in:
2020-04-02 14:07:02 +00:00
parent 7f947c23ef
commit 1384aef052
2 changed files with 11 additions and 11 deletions

View File

@@ -41,7 +41,7 @@ function devShowUnknownError(error) {
// return true if handled or false if not
//
function handleError(action, error, route, reject) {
var errorMessage =
let errorMessage =
"API error: " + action + " route =" + route + ", message =" + error.message;
window.$gz.store.commit("logItem", errorMessage);
@@ -269,7 +269,7 @@ export default {
if (typeof obj === "object") {
return Object.keys(obj)
.map(function(k) {
var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
let ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
if (Array.isArray(obj[k])) {
return obj[k]
.map(function(v) {
@@ -295,7 +295,7 @@ export default {
// GET DATA FROM API SERVER
//
get(route) {
var that = this;
let that = this;
return new Promise(function getDataFromServer(resolve, reject) {
fetch(that.APIUrl(route), that.fetchGetOptions())
.then(that.status)
@@ -313,10 +313,10 @@ export default {
// POST / PUT DATA TO API SERVER
//
upsert(route, data) {
var that = this;
let that = this;
return new Promise(function upsertDataToServer(resolve, reject) {
//determine if this is a new or existing record
var fetchOptions = undefined;
let fetchOptions = undefined;
if (data.concurrencyToken) {
//has concurrency token, so this is a PUT as it's updating an existing record
fetchOptions = that.fetchPutOptions(data);
@@ -346,7 +346,7 @@ export default {
// DELETE DATA FROM API SERVER
//
remove(route) {
var that = this;
let that = this;
return new Promise(function removeDataFromServer(resolve, reject) {
fetch(that.APIUrl(route), that.fetchRemoveOptions())
.then(that.status)
@@ -364,7 +364,7 @@ export default {
// POST DUPLICATE TO API SERVER
//
duplicate(route) {
var that = this;
let that = this;
return new Promise(function duplicateRecordOnServer(resolve, reject) {
fetch(that.APIUrl(route), that.fetchPostOptions(null))
.then(that.status)