From 4dfe90ce686f30005f6f6a511a8a83b8771030e2 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 25 Jun 2020 14:09:01 +0200 Subject: [PATCH] Fix event deletion from homepage Signed-off-by: Thomas Citharel --- js/src/views/Home.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js/src/views/Home.vue b/js/src/views/Home.vue index 31808cb7b..157f9edd8 100644 --- a/js/src/views/Home.vue +++ b/js/src/views/Home.vue @@ -80,6 +80,7 @@ @@ -99,6 +100,7 @@ v-for="participation in lastWeekEvents" :key="participation.id" :participation="participation" + @eventDeleted="eventDeleted" :options="{ hideDate: false }" /> @@ -163,6 +165,7 @@ import Subtitle from "../components/Utils/Subtitle.vue"; config: CONFIG, currentUserParticipations: { query: LOGGED_USER_PARTICIPATIONS, + fetchPolicy: "network-only", variables() { const lastWeek = new Date(); lastWeek.setDate(new Date().getDate() - 7); @@ -356,6 +359,12 @@ export default class Home extends Vue { ); } + eventDeleted(eventid: string) { + this.currentUserParticipations = this.currentUserParticipations.filter( + (participation) => participation.event.id !== eventid + ); + } + // getAddressData(addressData) { // const geoHash = ngeohash.encode( // addressData.latitude,