From e3e37620f03a91927db9e50c59ff12c896accaca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timoth=C3=A9e=20Poussard?= <tpoussard@neogeo.fr>
Date: Tue, 5 Oct 2021 15:46:14 +0200
Subject: [PATCH] add status 204 to error detection in project_mapping and
 remove empty container for messages in App.vue

---
 src/App.vue                           | 4 ++--
 src/store/index.js                    | 2 +-
 src/views/project/Project_mapping.vue | 3 ++-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/App.vue b/src/App.vue
index a84aec7f..2c345237 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -132,8 +132,8 @@
       </div>
     </header>
     <main>
-      <div id="messages" class="ui stackable grid centered container">
-        <div v-if="messages" class="row">
+      <div id="content" class="ui stackable grid centered container">
+        <div v-if="messages && messages.length > 0" class="row">
           <div class="fourteen wide column">
             <div
               v-for="(message, index) in messages"
diff --git a/src/store/index.js b/src/store/index.js
index 42f24525..713cf40a 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -92,7 +92,7 @@ export default new Vuex.Store({
     },
     DISPLAY_MESSAGE(state, comment) {
       state.messages = [{ comment }, ...state.messages];
-      document.getElementById("messages").scrollIntoView({ block: "start", inline: "nearest" });
+      document.getElementById("content").scrollIntoView({ block: "start", inline: "nearest" });
     },
     CLEAR_MESSAGES(state) {
       state.messages = [];
diff --git a/src/views/project/Project_mapping.vue b/src/views/project/Project_mapping.vue
index fb34bc26..976ea82b 100644
--- a/src/views/project/Project_mapping.vue
+++ b/src/views/project/Project_mapping.vue
@@ -102,7 +102,8 @@ export default {
           .dispatch("map/SAVE_BASEMAPS", this.newBasemapIds)
           .then((response) => {
             const errors = response.filter(
-              (res) => res.status !== 200 && res.status !== 204
+              (res) =>
+                res.status === 200 && res.status === 201 && res.status === 204
             );
             if (errors.length === 0) {
               this.infoMessage.push({
-- 
GitLab