Properly handle not found event
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
442a011490
commit
30d901605d
@ -219,6 +219,8 @@ import { CREATE_REPORT } from '@/graphql/report';
|
|||||||
import EventMixin from '@/mixins/event';
|
import EventMixin from '@/mixins/event';
|
||||||
import IdentityPicker from '@/views/Account/IdentityPicker.vue';
|
import IdentityPicker from '@/views/Account/IdentityPicker.vue';
|
||||||
import ParticipationButton from '@/components/Event/ParticipationButton.vue';
|
import ParticipationButton from '@/components/Event/ParticipationButton.vue';
|
||||||
|
import { GraphQLError } from 'graphql';
|
||||||
|
import { RouteName } from '@/router';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: {
|
components: {
|
||||||
@ -242,6 +244,9 @@ import ParticipationButton from '@/components/Event/ParticipationButton.vue';
|
|||||||
uuid: this.uuid,
|
uuid: this.uuid,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
error({ graphQLErrors }) {
|
||||||
|
this.handleErrors(graphQLErrors);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
currentActor: {
|
currentActor: {
|
||||||
query: CURRENT_ACTOR_CLIENT,
|
query: CURRENT_ACTOR_CLIENT,
|
||||||
@ -271,7 +276,6 @@ export default class Event extends EventMixin {
|
|||||||
showMap: boolean = false;
|
showMap: boolean = false;
|
||||||
isReportModalActive: boolean = false;
|
isReportModalActive: boolean = false;
|
||||||
isJoinModalActive: boolean = false;
|
isJoinModalActive: boolean = false;
|
||||||
|
|
||||||
EventVisibility = EventVisibility;
|
EventVisibility = EventVisibility;
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -433,6 +437,12 @@ export default class Event extends EventMixin {
|
|||||||
document.body.removeChild(link);
|
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() {
|
get actorIsParticipant() {
|
||||||
if (this.actorIsOrganizer) return true;
|
if (this.actorIsOrganizer) return true;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user