fix: frontend error codes and translations
This commit is contained in:
@@ -77,7 +77,7 @@ export const mutatePassword = async (payload: ChangePasswordIntf) => {
|
||||
|
||||
const response = await result.json();
|
||||
|
||||
if (response.code === "su005") {
|
||||
if (response.code === "SU005") {
|
||||
return {code: response.code};
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ export const getProducts = async () => {
|
||||
});
|
||||
const response = await result.json();
|
||||
|
||||
if (response.code === "sp002") {
|
||||
if (response.code === "SP002") {
|
||||
return response.data;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ export const getProductDetails = async (uuid: string) => {
|
||||
|
||||
const response = await result.json();
|
||||
|
||||
if (response.code === "sp003") {
|
||||
if (response.code === "SP003") {
|
||||
return response.data;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ export const mutateProduct = async (
|
||||
|
||||
const response = await result.json();
|
||||
|
||||
if (response.code === "sp005") {
|
||||
if (response.code === "SP005") {
|
||||
return response.data;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ export const deleteSelectedProducts = async (uuids: string[]) => {
|
||||
|
||||
const response = await result.json();
|
||||
|
||||
if (response.code === "sp006") {
|
||||
if (response.code === "SP006") {
|
||||
return {success: true};
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ export const createProduct = async (values: ProductFormValues) => {
|
||||
|
||||
const response = await result.json();
|
||||
|
||||
if (response.code === "sp001") {
|
||||
if (response.code === "SP001") {
|
||||
return response.data;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ export const fetchSettings = async () => {
|
||||
|
||||
const response = await result.json();
|
||||
|
||||
if (response.code === "su004") {
|
||||
if (response.code === "SU004") {
|
||||
return {success: true, data: response.data, code: response.code};
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ export const mutateSettings = async (payload: SettingsIntf) => {
|
||||
|
||||
const response = await result.json();
|
||||
|
||||
if (response.code === "su003") {
|
||||
if (response.code === "SU003") {
|
||||
return {success: true, code: response.code};
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ export const getStorages = async () => {
|
||||
|
||||
const response = await result.json();
|
||||
|
||||
if (response.code === "ss001") {
|
||||
if (response.code === "SS001") {
|
||||
return response.data;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ export const mutateNewStorage = async (values: NewStorage) => {
|
||||
|
||||
const response = await result.json();
|
||||
|
||||
if (response.code === "ss002") {
|
||||
if (response.code === "SS002") {
|
||||
return response.data;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ export const deleteStorage = async (uuid: string) => {
|
||||
|
||||
const response = await result.json();
|
||||
|
||||
if (response.code === "ss004") {
|
||||
if (response.code === "SS004") {
|
||||
return {success: true, code: response.code};
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
"details": "Details",
|
||||
"username": "Benutzername",
|
||||
"password": "Passwort",
|
||||
"eu001": "Falscher Benutzername oder Passwort!",
|
||||
"login": "Login",
|
||||
"product-name": "Produktname",
|
||||
"price": "Preis",
|
||||
@@ -57,5 +56,29 @@
|
||||
"change": "Ändern",
|
||||
"error": "Fehler",
|
||||
"success": "Erfolg",
|
||||
"submit": "Absenden"
|
||||
"submit": "Absenden",
|
||||
"EG001": "Ein unerwarteter Fehler ist aufgetreten. Bitte versuchen Sie es später erneut.",
|
||||
"EU001": "Falscher Benutzername oder Passwort!",
|
||||
"EU002": "Ihr Konto wurde deaktiviert. Bitte wenden Sie sich an einen Administrator.",
|
||||
"EU003": "Bitte geben Sie Benutzername und Passwort ein.",
|
||||
"EU004": "Einige erforderliche Angaben fehlen. Bitte überprüfen Sie Ihre Eingabe.",
|
||||
"EU005": "Anmeldung aufgrund eines technischen Problems fehlgeschlagen. Bitte versuchen Sie es erneut.",
|
||||
"EU006": "Anmeldung fehlgeschlagen. Bitte versuchen Sie es erneut.",
|
||||
"EU007": "Passwort konnte nicht geändert werden. Bitte versuchen Sie es erneut.",
|
||||
"EU008": "Ihre Einstellungen konnten nicht gespeichert werden. Bitte versuchen Sie es erneut.",
|
||||
"EU009": "Ihre Einstellungen konnten nicht geladen werden. Bitte versuchen Sie es erneut.",
|
||||
"ES001": "Bitte füllen Sie alle erforderlichen Felder für den Lagerort aus.",
|
||||
"ES002": "Einige erforderliche Lagerinformationen fehlen. Bitte überprüfen Sie Ihre Eingabe.",
|
||||
"ES003": "Der Lagerort konnte nicht aktualisiert werden. Bitte versuchen Sie es erneut.",
|
||||
"ES004": "Der Lagerort konnte nicht gelöscht werden. Bitte versuchen Sie es erneut.",
|
||||
"ES005": "Keine Lagerorte gefunden.",
|
||||
"ES006": "Der Lagerort konnte nicht erstellt werden. Bitte versuchen Sie es erneut.",
|
||||
"EP001": "Das Produkt konnte nicht erstellt werden. Bitte versuchen Sie es erneut.",
|
||||
"EP002": "Keine Produkte gefunden.",
|
||||
"EP003": "Produkt nicht gefunden.",
|
||||
"EP004": "Die Produktmenge konnte nicht aktualisiert werden. Bitte versuchen Sie es erneut.",
|
||||
"EP005": "Das Produkt konnte nicht aktualisiert werden. Bitte versuchen Sie es erneut.",
|
||||
"EP006": "Das Produkt konnte nicht gelöscht werden. Bitte versuchen Sie es erneut.",
|
||||
"EP007": "Bitte geben Sie mindestens einen Produktnamen ein.",
|
||||
"EP008": "Einige erforderliche Produktinformationen fehlen. Bitte überprüfen Sie Ihre Eingabe."
|
||||
}
|
||||
@@ -6,7 +6,6 @@
|
||||
"details": "Details",
|
||||
"username": "Username",
|
||||
"password": "Password",
|
||||
"eu001": "Wrong username or password!",
|
||||
"login": "Login",
|
||||
"product-name": "Product name",
|
||||
"price": "Price",
|
||||
@@ -57,5 +56,29 @@
|
||||
"change": "Change",
|
||||
"error": "Error",
|
||||
"success": "Success",
|
||||
"submit": "Submit"
|
||||
"submit": "Submit",
|
||||
"EG001": "An unexpected error occurred. Please try again later.",
|
||||
"EU001": "Wrong username or password!",
|
||||
"EU002": "Your account has been deactivated. Please contact an administrator.",
|
||||
"EU003": "Please enter both username and password.",
|
||||
"EU004": "Some required information is missing. Please check your input.",
|
||||
"EU005": "Login failed due to a technical issue. Please try again.",
|
||||
"EU006": "Login failed. Please try again.",
|
||||
"EU007": "Failed to change your password. Please try again.",
|
||||
"EU008": "Your settings could not be saved. Please try again.",
|
||||
"EU009": "Your settings could not be loaded. Please try again.",
|
||||
"ES001": "Please fill in all required fields for the storage location.",
|
||||
"ES002": "Some required storage information is missing. Please check your input.",
|
||||
"ES003": "The storage location could not be updated. Please try again.",
|
||||
"ES004": "The storage location could not be deleted. Please try again.",
|
||||
"ES005": "No storage locations found.",
|
||||
"ES006": "The storage location could not be created. Please try again.",
|
||||
"EP001": "The product could not be created. Please try again.",
|
||||
"EP002": "No products found.",
|
||||
"EP003": "Product not found.",
|
||||
"EP004": "The product amount could not be updated. Please try again.",
|
||||
"EP005": "The product could not be updated. Please try again.",
|
||||
"EP006": "The product could not be deleted. Please try again.",
|
||||
"EP007": "Please enter at least a product name.",
|
||||
"EP008": "Some required product information is missing. Please check your input."
|
||||
}
|
||||
Reference in New Issue
Block a user