Fix posts and rework graphql errors
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -335,6 +335,7 @@ section {
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
|
||||
import { RefetchQueryDescription } from "apollo-client/core/watchQueryOptions";
|
||||
import PictureUpload from "@/components/PictureUpload.vue";
|
||||
import EditorComponent from "@/components/Editor.vue";
|
||||
import DateTimePicker from "@/components/Event/DateTimePicker.vue";
|
||||
@@ -373,7 +374,6 @@ import RouteName from "../../router/name";
|
||||
import "intersection-observer";
|
||||
import { CONFIG } from "../../graphql/config";
|
||||
import { IConfig } from "../../types/config.model";
|
||||
import { RefetchQueryDescription } from "apollo-client/core/watchQueryOptions";
|
||||
|
||||
const DEFAULT_LIMIT_NUMBER_OF_PLACES = 10;
|
||||
|
||||
|
||||
@@ -965,12 +965,12 @@ export default class Event extends EventMixin {
|
||||
// @ts-ignore-end
|
||||
}
|
||||
|
||||
async handleErrors(errors: GraphQLError[]): Promise<void> {
|
||||
handleErrors(errors: any[]): void {
|
||||
if (
|
||||
errors[0].message.includes("not found") ||
|
||||
errors[0].message.includes("has invalid value $uuid")
|
||||
errors.some((error) => error.status_code === 404) ||
|
||||
errors.some(({ message }) => message.includes("has invalid value $uuid"))
|
||||
) {
|
||||
await this.$router.push({ name: RouteName.PAGE_NOT_FOUND });
|
||||
this.$router.replace({ name: RouteName.PAGE_NOT_FOUND });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user