TF-102 fixed error handler when response is logic error
This commit is contained in:
@@ -3,11 +3,11 @@ import WarningNotification from "@/core/components/notifications/WarningNotifica
|
|||||||
import {toast} from "react-toastify";
|
import {toast} from "react-toastify";
|
||||||
|
|
||||||
export const errorSetting = (t, notification) => {
|
export const errorSetting = (t, notification) => {
|
||||||
//todo
|
if (notification) toast.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
export const errorRequest = (t, notification) => {
|
export const errorRequest = (t, notification) => {
|
||||||
//todo
|
if (notification) toast.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
export const errorResponse = (response, clearToken, t, notification) => {
|
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 isClientError = status => status >= 400 && status <= 499;
|
||||||
|
|
||||||
const errorLogic = (response, t, notification) => {
|
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) => {
|
const errorValidation = (response, t, notification) => {
|
||||||
if (notification) {
|
if (notification) {
|
||||||
@@ -59,4 +59,4 @@ const errorValidation = (response, t, notification) => {
|
|||||||
ErrorNotification(t, response.status, errorsArray[item][0]);
|
ErrorNotification(t, response.status, errorsArray[item][0]);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user