Evict the event from the cache when it's deleted
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
60f5a76e57
commit
f58cc98e55
@ -150,7 +150,7 @@ export default class EventMixin extends mixins(Vue) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async deleteEvent(event: IEvent) {
|
private async deleteEvent(event: IEvent) {
|
||||||
const eventTitle = event.title;
|
const { title: eventTitle, id: eventId } = event;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.$apollo.mutate<IParticipant>({
|
await this.$apollo.mutate<IParticipant>({
|
||||||
@ -159,6 +159,9 @@ export default class EventMixin extends mixins(Vue) {
|
|||||||
eventId: event.id,
|
eventId: event.id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const cache = this.$apollo.getClient().cache as InMemoryCache;
|
||||||
|
cache.evict({ id: `Event:${eventId}` });
|
||||||
|
cache.gc();
|
||||||
/**
|
/**
|
||||||
* When the event corresponding has been deleted (by the organizer).
|
* When the event corresponding has been deleted (by the organizer).
|
||||||
* A notification is already triggered.
|
* A notification is already triggered.
|
||||||
|
Loading…
Reference in New Issue
Block a user