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) {