rename Handler functions to do not have a data and methods property error

This commit is contained in:
Harald Bamberger
2022-08-18 15:27:02 +02:00
parent c9eb60aade
commit 582cb20b72
+6 -6
View File
@@ -65,9 +65,9 @@ export const CoreFetchCmpt = {
if (apiFunctionResult instanceof Promise)
{
apiFunctionResult
.then(this.success) // on success
.catch(this.error) // on error
.then(this.finally); // finally in any case
.then(this.successHandler) // on success
.catch(this.errorHandler) // on error
.finally(this.finallyHandler); // finally in any case
}
else // otherwise display an error
{
@@ -90,19 +90,19 @@ export const CoreFetchCmpt = {
/**
*
*/
success: function(response) {
successHandler: function(response) {
this.$emit('dataFetched', response.data); // trigger the event dataFetched
},
/**
*
*/
error: function(error) {
errorHandler: function(error) {
this.setError(error.message);
},
/**
*
*/
finally: function() {
finallyHandler: function() {
this.loading = false; // loading ended
}
},