forked from potsda.mn/mobilizon
Fix event deletion from homepage
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
97c153ada3
commit
04f037a20b
|
@ -80,6 +80,7 @@
|
||||||
<EventListCard
|
<EventListCard
|
||||||
v-for="participation in row[1]"
|
v-for="participation in row[1]"
|
||||||
v-if="isInLessThanSevenDays(row[0])"
|
v-if="isInLessThanSevenDays(row[0])"
|
||||||
|
@eventDeleted="eventDeleted"
|
||||||
:key="participation[1].id"
|
:key="participation[1].id"
|
||||||
:participation="participation[1]"
|
:participation="participation[1]"
|
||||||
/>
|
/>
|
||||||
|
@ -99,6 +100,7 @@
|
||||||
v-for="participation in lastWeekEvents"
|
v-for="participation in lastWeekEvents"
|
||||||
:key="participation.id"
|
:key="participation.id"
|
||||||
:participation="participation"
|
:participation="participation"
|
||||||
|
@eventDeleted="eventDeleted"
|
||||||
:options="{ hideDate: false }"
|
:options="{ hideDate: false }"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -163,6 +165,7 @@ import Subtitle from "../components/Utils/Subtitle.vue";
|
||||||
config: CONFIG,
|
config: CONFIG,
|
||||||
currentUserParticipations: {
|
currentUserParticipations: {
|
||||||
query: LOGGED_USER_PARTICIPATIONS,
|
query: LOGGED_USER_PARTICIPATIONS,
|
||||||
|
fetchPolicy: "network-only",
|
||||||
variables() {
|
variables() {
|
||||||
const lastWeek = new Date();
|
const lastWeek = new Date();
|
||||||
lastWeek.setDate(new Date().getDate() - 7);
|
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) {
|
// getAddressData(addressData) {
|
||||||
// const geoHash = ngeohash.encode(
|
// const geoHash = ngeohash.encode(
|
||||||
// addressData.latitude,
|
// addressData.latitude,
|
||||||
|
|
Loading…
Reference in a new issue