Fixes for event deletion and updates

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2019-09-05 14:55:20 +02:00
parent 060f6c8775
commit bcfb142d5b
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773
2 changed files with 9 additions and 2 deletions

View file

@ -22,7 +22,7 @@ import { ITag } from '@/types/tag.model';
computed: { computed: {
tagsStrings: { tagsStrings: {
get() { get() {
return this.$props.data.map((tag: ITag) => tag.title); return this.$props.value.map((tag: ITag) => tag.title);
}, },
set(tagStrings) { set(tagStrings) {
const tagEntities = tagStrings.map((tag) => { const tagEntities = tagStrings.map((tag) => {

View file

@ -279,6 +279,7 @@ export default class Event extends Vue {
async deleteEvent() { async deleteEvent() {
const router = this.$router; const router = this.$router;
const eventTitle = this.event.title;
try { try {
await this.$apollo.mutate<IParticipant>({ await this.$apollo.mutate<IParticipant>({
@ -289,7 +290,13 @@ export default class Event extends Vue {
}, },
}); });
await router.push({ name: RouteName.EVENT }); await router.push({ name: RouteName.HOME });
this.$buefy.notification.open({
message: this.$gettextInterpolate('Event %{eventTitle} deleted', { eventTitle }),
type: 'is-success',
position: 'is-bottom-right',
duration: 5000,
});
} catch (error) { } catch (error) {
console.error(error); console.error(error);
} }