mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Merge branch 'add_toasters' into 'master'
Display of toasts for accompanying course + general makeFetch See merge request Chill-Projet/chill-bundles!221
This commit is contained in:
commit
bd98e9cc9b
@ -48,7 +48,6 @@ const whoami = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
whoami,
|
whoami,
|
||||||
getSocialIssues,
|
getSocialIssues,
|
||||||
|
@ -78,8 +78,15 @@ export default {
|
|||||||
this.$store.dispatch('fetchPermissions').then(() => {
|
this.$store.dispatch('fetchPermissions').then(() => {
|
||||||
if (!this.$store.getters.canTogglePermission) {
|
if (!this.$store.getters.canTogglePermission) {
|
||||||
this.$toast.open({message: "Seul le référent peut modifier la confidentialité"});
|
this.$toast.open({message: "Seul le référent peut modifier la confidentialité"});
|
||||||
|
return Promise.resolve();
|
||||||
} else {
|
} else {
|
||||||
this.$store.dispatch('toggleConfidential', (!this.isConfidential));
|
return this.$store.dispatch('toggleConfidential', (!this.isConfidential));
|
||||||
|
}
|
||||||
|
}).catch(({name, violations}) => {
|
||||||
|
if (name === 'ValidationException' || name === 'AccessException') {
|
||||||
|
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||||
|
} else {
|
||||||
|
this.$toast.open({message: 'An error occurred'})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user