Skip to content

Commit

Permalink
Revert "fix: Upload constitution error message based on error status"
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristina2103 authored Jun 25, 2024
1 parent 8ae1ede commit d091971
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 18 deletions.
5 changes: 0 additions & 5 deletions frontend/messages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,5 @@
"Filters": {
"sortBy": "Sort by",
"clear": "Clear"
},
"Errors": {
"uploadConstitution": {
"409": "File already exists."
}
}
}
5 changes: 0 additions & 5 deletions frontend/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,5 @@
"Filters": {
"sortBy": "Sort by",
"clear": "Clear"
},
"Errors": {
"uploadConstitution": {
"409": "File already exists."
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
5 changes: 0 additions & 5 deletions frontend/src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean> {
Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit d091971

Please sign in to comment.