From 07abe66af18fca0d15ae9e1657534e14f24575f6 Mon Sep 17 00:00:00 2001 From: wvffle Date: Fri, 5 Aug 2022 14:20:20 +0000 Subject: [PATCH] Performance fixes --- front/src/init/axios.ts | 1 + front/src/utils/index.ts | 11 +---------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/front/src/init/axios.ts b/front/src/init/axios.ts index a0a7741ae..95574eefd 100644 --- a/front/src/init/axios.ts +++ b/front/src/init/axios.ts @@ -44,6 +44,7 @@ export const install: InitModule = ({ store, router }) => { content: error.response?.data, class: 'error' }) + break case 403: error.backendErrors.push('Permission denied') diff --git a/front/src/utils/index.ts b/front/src/utils/index.ts index 38fdce8a6..1fd4b0f3d 100644 --- a/front/src/utils/index.ts +++ b/front/src/utils/index.ts @@ -31,17 +31,8 @@ export function parseAPIErrors (responseData: APIErrorResponse, parentField?: st return errors } -export function getCookie (name: string) { - return document.cookie - .split('; ') - .find(row => row.startsWith(name)) - ?.split('=')[1] -} - export function getDomain (url: string) { - const parser = document.createElement('a') - parser.href = url - return parser.hostname + return new URL(url).hostname } export function arrayMove (arr: unknown[], oldIndex: number, newIndex: number) {