named anonymous functions
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user