diff --git a/js/src/views/Event/Event.vue b/js/src/views/Event/Event.vue index ce884a815..6e2289726 100644 --- a/js/src/views/Event/Event.vue +++ b/js/src/views/Event/Event.vue @@ -219,6 +219,8 @@ import { CREATE_REPORT } from '@/graphql/report'; import EventMixin from '@/mixins/event'; import IdentityPicker from '@/views/Account/IdentityPicker.vue'; import ParticipationButton from '@/components/Event/ParticipationButton.vue'; +import { GraphQLError } from 'graphql'; +import { RouteName } from '@/router'; @Component({ components: { @@ -242,6 +244,9 @@ import ParticipationButton from '@/components/Event/ParticipationButton.vue'; uuid: this.uuid, }; }, + error({ graphQLErrors }) { + this.handleErrors(graphQLErrors); + }, }, currentActor: { query: CURRENT_ACTOR_CLIENT, @@ -271,7 +276,6 @@ export default class Event extends EventMixin { showMap: boolean = false; isReportModalActive: boolean = false; isJoinModalActive: boolean = false; - EventVisibility = EventVisibility; mounted() { @@ -433,6 +437,12 @@ export default class Event extends EventMixin { document.body.removeChild(link); } + async handleErrors(errors: GraphQLError) { + if (errors[0].message.includes('not found')) { + await this.$router.push({ name: RouteName.PAGE_NOT_FOUND }); + } + } + get actorIsParticipant() { if (this.actorIsOrganizer) return true;