diff --git a/frontend/messages/de.json b/frontend/messages/de.json index 9f1e994d..d6ea5ffc 100644 --- a/frontend/messages/de.json +++ b/frontend/messages/de.json @@ -255,10 +255,5 @@ "Filters": { "sortBy": "Sort by", "clear": "Clear" - }, - "Errors": { - "uploadConstitution": { - "409": "File already exists." - } } } diff --git a/frontend/messages/en.json b/frontend/messages/en.json index 9f1e994d..d6ea5ffc 100644 --- a/frontend/messages/en.json +++ b/frontend/messages/en.json @@ -255,10 +255,5 @@ "Filters": { "sortBy": "Sort by", "clear": "Clear" - }, - "Errors": { - "uploadConstitution": { - "409": "File already exists." - } } } diff --git a/frontend/src/components/organisms/Modals/UploadConstitution.tsx b/frontend/src/components/organisms/Modals/UploadConstitution.tsx index 4b144801..1df38280 100644 --- a/frontend/src/components/organisms/Modals/UploadConstitution.tsx +++ b/frontend/src/components/organisms/Modals/UploadConstitution.tsx @@ -32,9 +32,7 @@ export const UploadConstitution = () => { addSuccessAlert(t("uploadConstitution.alerts.success")); closeModal(); } catch (error) { - addErrorAlert( - error.message ? error.message : t("uploadConstitution.alerts.error") - ); + addErrorAlert(t("uploadConstitution.alerts.error")); } finally { setSubmitting(false); } diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index 084de03d..a52d478e 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -18,7 +18,6 @@ import { GovActionStatus, PreviewReasoningModalState, } from "@/components/organisms"; -import { getTranslations } from "next-intl/server"; const baseURL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:1337"; export async function isTokenExpired(token): Promise { @@ -405,10 +404,6 @@ export async function uploadConstitution(data: FormData) { }); return response.data; } catch (error) { - const t = await getTranslations(); - if (error.res.statusCode === 409) { - throw new Error(t(`Errors.uploadConstitution.${error.res.statusCode}`)); - } throw error; } }