TF-102 fixed error handler when response is logic error

This commit is contained in:
AmirHossein Mahmoodi
2023-09-27 10:34:32 +03:30
parent 67e1801bb5
commit 650c02e09e

View File

@@ -3,11 +3,11 @@ import WarningNotification from "@/core/components/notifications/WarningNotifica
import {toast} from "react-toastify";
export const errorSetting = (t, notification) => {
//todo
if (notification) toast.dismiss();
}
export const errorRequest = (t, notification) => {
//todo
if (notification) toast.dismiss();
}
export const errorResponse = (response, clearToken, t, notification) => {
@@ -48,7 +48,7 @@ const isServerError = status => status >= 500 && status <= 599;
const isClientError = status => status >= 400 && status <= 499;
const errorLogic = (response, t, notification) => {
if (notification) ErrorNotification(t, response.status)
if (notification) ErrorNotification(t, response.status, response.data.message)
}
const errorValidation = (response, t, notification) => {
if (notification) {
@@ -59,4 +59,4 @@ const errorValidation = (response, t, notification) => {
ErrorNotification(t, response.status, errorsArray[item][0]);
})
}
}
}