Skip to content
Snippets Groups Projects
Commit e3e37620 authored by Timothee P's avatar Timothee P :sunflower:
Browse files

add status 204 to error detection in project_mapping and remove empty...

add status 204 to error detection in project_mapping and remove empty container for messages in App.vue
parent 597ec394
No related branches found
No related tags found
No related merge requests found
...@@ -132,8 +132,8 @@ ...@@ -132,8 +132,8 @@
</div> </div>
</header> </header>
<main> <main>
<div id="messages" class="ui stackable grid centered container"> <div id="content" class="ui stackable grid centered container">
<div v-if="messages" class="row"> <div v-if="messages && messages.length > 0" class="row">
<div class="fourteen wide column"> <div class="fourteen wide column">
<div <div
v-for="(message, index) in messages" v-for="(message, index) in messages"
......
...@@ -92,7 +92,7 @@ export default new Vuex.Store({ ...@@ -92,7 +92,7 @@ export default new Vuex.Store({
}, },
DISPLAY_MESSAGE(state, comment) { DISPLAY_MESSAGE(state, comment) {
state.messages = [{ comment }, ...state.messages]; state.messages = [{ comment }, ...state.messages];
document.getElementById("messages").scrollIntoView({ block: "start", inline: "nearest" }); document.getElementById("content").scrollIntoView({ block: "start", inline: "nearest" });
}, },
CLEAR_MESSAGES(state) { CLEAR_MESSAGES(state) {
state.messages = []; state.messages = [];
......
...@@ -102,7 +102,8 @@ export default { ...@@ -102,7 +102,8 @@ export default {
.dispatch("map/SAVE_BASEMAPS", this.newBasemapIds) .dispatch("map/SAVE_BASEMAPS", this.newBasemapIds)
.then((response) => { .then((response) => {
const errors = response.filter( 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) { if (errors.length === 0) {
this.infoMessage.push({ this.infoMessage.push({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment