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

display message

parent 597ec394
No related branches found
No related tags found
No related merge requests found
......@@ -93,6 +93,10 @@ export default new Vuex.Store({
DISPLAY_MESSAGE(state, comment) {
state.messages = [{ comment }, ...state.messages];
document.getElementById("messages").scrollIntoView({ block: "start", inline: "nearest" });
setTimeout(() => {
state.messages = [];
}, 3000);
},
CLEAR_MESSAGES(state) {
state.messages = [];
......
......@@ -107,6 +107,13 @@ export default {
.then((response) => {
if (response.status === 200) {
this.$store.dispatch("GET_USER_LEVEL_PROJECTS"); //* update user status in top right menu
this.$store.commit("DISPLAY_MESSAGE", "Permissions mises à jour");
} else {
this.$store.commit(
"DISPLAY_MESSAGE",
"Une erreur s'est produite pendant la mises à jour des permissions"
);
}
})
.catch((error) => {
......
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