complete user settings

This commit is contained in:
Rodrigo Quelca
2021-08-30 23:32:23 +00:00
parent e9f32179ae
commit d818744e93
7 changed files with 127 additions and 61 deletions

View File

@@ -34,7 +34,6 @@
@onLastPage="onLastPage"
@onUpdateFilters="onUpdateFilters"
@cleanDefaultOption="cleanDefaultOption"
@updateUserSettings="updateUserSettings"
@updateSettings="updateSettings"
></component>
</div>
@@ -213,27 +212,6 @@ export default {
console.error(e);
});
},
/**
* Update the user config service
*/
updateUserSettings(prop, data) {
if (this.config.setting) {
if (!this.config.setting[this.page]) {
this.config.setting[this.page] = {};
}
this.config.setting[this.page][prop] = data;
api.config
.put(this.config)
.then((response) => {
if (response.data) {
//TODO success response
}
})
.catch((e) => {
console.error(e);
});
}
},
/**
* Update the user config service
* @param {object} params
@@ -254,7 +232,7 @@ export default {
if (!this.config.setting[this.page]) {
this.config.setting[this.page] = {};
}
this.config.setting[this.page][params.key] = data;
this.config.setting[this.page][params.key] = params.data;
}
api.config
.put(this.config)
@@ -283,7 +261,7 @@ export default {
}
this.settings = this.config.setting[this.page];
this.lastPage = this.page;
},
},
/**
* Do a mapping of vue view for menus
* @returns array
@@ -424,7 +402,6 @@ export default {
this.settings = {};
}
}
if (this.page === this.lastPage
&& this.$refs["component"]
&& this.$refs["component"].updateView) {