Fix event deletion from homepage

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2020-06-25 14:09:01 +02:00
parent b0db75921d
commit 4dfe90ce68

View File

@ -80,6 +80,7 @@
<EventListCard
v-for="participation in row[1]"
v-if="isInLessThanSevenDays(row[0])"
@eventDeleted="eventDeleted"
:key="participation[1].id"
:participation="participation[1]"
/>
@ -99,6 +100,7 @@
v-for="participation in lastWeekEvents"
:key="participation.id"
:participation="participation"
@eventDeleted="eventDeleted"
:options="{ hideDate: false }"
/>
</div>
@ -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,