fixed bug
This commit is contained in:
@@ -214,3 +214,31 @@ export const errorClientToast = (toastContainer) =>
|
||||
draggable: false,
|
||||
}
|
||||
);
|
||||
|
||||
export const errorMaxLengthToast = (toastContainer) =>
|
||||
toast.error(
|
||||
() => (
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
alignItems: "start",
|
||||
justifyContent: "start",
|
||||
}}
|
||||
>
|
||||
<Box sx={{ display: "flex", alignItems: "center" }}>
|
||||
<Dangerous color="error" sx={{ mr: 1.6 }} />
|
||||
<Box sx={{ display: "flex", flexDirection: "column" }}>
|
||||
<Typography variant="caption">{"حجم درخواست بیشتر از حد مجاز است."}</Typography>
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
),
|
||||
{
|
||||
icon: false,
|
||||
containerId: toastContainer,
|
||||
autoClose: false,
|
||||
closeOnClick: false,
|
||||
draggable: false,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
errorAccessDeniedToast,
|
||||
errorClientToast,
|
||||
errorLogicToast,
|
||||
errorMaxLengthToast,
|
||||
errorServerToast,
|
||||
errorTooManyToast,
|
||||
errorUnauthorizedToast,
|
||||
@@ -26,6 +27,9 @@ const errorClient = (response, notification, toastContainer, logout) => {
|
||||
case 403:
|
||||
if (notification) errorAccessDeniedToast(response.data.message, toastContainer);
|
||||
break;
|
||||
case 413:
|
||||
if (notification) errorMaxLengthToast(response.data.message, toastContainer);
|
||||
break;
|
||||
case 422:
|
||||
if ("type" in response.data) {
|
||||
if (Array.isArray(response.data.message)) {
|
||||
|
||||
Reference in New Issue
Block a user