named anonymous functions

This commit is contained in:
2019-04-18 19:51:21 +00:00
parent 7770b8bad1
commit 8cdae969fb
13 changed files with 43 additions and 39 deletions

View File

@@ -233,14 +233,14 @@ export default {
//
get(route) {
var that = this;
return new Promise(function(resolve, reject) {
return new Promise(function getDataFromServer(resolve, reject) {
fetch(that.APIUrl(route), that.fetchGetOptions())
.then(that.status)
.then(that.json)
.then(response => {
resolve(response);
})
.catch(function(error) {
.catch(function handleGetError(error) {
//fundamental error, can't proceed with this call
handleError("GET", error, route, reject);
});
@@ -251,7 +251,7 @@ export default {
//
upsert(route, data) {
var that = this;
return new Promise(function(resolve, reject) {
return new Promise(function upsertDataToServer(resolve, reject) {
//determine if this is a new or existing record
var fetchOptions = undefined;
if (data.concurrencyToken) {
@@ -268,7 +268,7 @@ export default {
//and let the caller deal with it appropriately
resolve(response);
})
.catch(function(error) {
.catch(function handleUpsertError(error) {
handleError("UPSERT", error, route, reject);
});
});