diff --git a/src/store/modules/map.js b/src/store/modules/map.js index 416cc1ecddd93c809954ccbf0db5f0dff2c777cb..8ef4ebadb66690c99ac21c3592a1f2aa3800048d 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -192,7 +192,6 @@ const map = { return axios .delete(url) .then((response) => { - console.log(response) if (response && response.status === 204) { commit("REMOVE_BASEMAP_ID_TO_DELETE", basemapId) return response diff --git a/src/views/project/Project_mapping.vue b/src/views/project/Project_mapping.vue index 7aabdaf58b416e61c02cd191ea9d4c6619a76b53..94e6d85641815c3938fcadf2b60f75da7b5d93f1 100644 --- a/src/views/project/Project_mapping.vue +++ b/src/views/project/Project_mapping.vue @@ -96,24 +96,30 @@ export default { }, saveChanges() { - // ToDo : check if values are filled if (this.checkTitles()) { this.$store .dispatch("map/SAVE_BASEMAPS", this.newBasemapIds) - .then((res) => { - console.log("res", res); + .then((response) => { + const errors = response.filter( + (res) => res.status !== 200 && res.status !== 204 + ); + if (errors.length === 0) { + this.newBasemapIds = []; + this.infoMessage = "Enregistrement effectué."; + document + .getElementById("message_info") + .scrollIntoView({ block: "end", inline: "nearest" }); + setTimeout( + function () { + this.infoMessage = ""; + }.bind(this), + 5000 + ); + } }) .catch((error) => { console.log(error); }); - this.newBasemapIds = []; - this.infoMessage = "Enregistrement effectué."; - setTimeout( - function () { - this.infoMessage = ""; - }.bind(this), - 5000 - ); } }, },