fixed bug
This commit is contained in:
@@ -214,3 +214,31 @@ export const errorClientToast = (toastContainer) =>
|
|||||||
draggable: false,
|
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,
|
errorAccessDeniedToast,
|
||||||
errorClientToast,
|
errorClientToast,
|
||||||
errorLogicToast,
|
errorLogicToast,
|
||||||
|
errorMaxLengthToast,
|
||||||
errorServerToast,
|
errorServerToast,
|
||||||
errorTooManyToast,
|
errorTooManyToast,
|
||||||
errorUnauthorizedToast,
|
errorUnauthorizedToast,
|
||||||
@@ -26,6 +27,9 @@ const errorClient = (response, notification, toastContainer, logout) => {
|
|||||||
case 403:
|
case 403:
|
||||||
if (notification) errorAccessDeniedToast(response.data.message, toastContainer);
|
if (notification) errorAccessDeniedToast(response.data.message, toastContainer);
|
||||||
break;
|
break;
|
||||||
|
case 413:
|
||||||
|
if (notification) errorMaxLengthToast(response.data.message, toastContainer);
|
||||||
|
break;
|
||||||
case 422:
|
case 422:
|
||||||
if ("type" in response.data) {
|
if ("type" in response.data) {
|
||||||
if (Array.isArray(response.data.message)) {
|
if (Array.isArray(response.data.message)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user