fixed bug

This commit is contained in:
AmirHossein Mahmoodi
2025-09-29 10:35:01 +03:30
parent 4f206e9c6c
commit 55b1f45e7c
2 changed files with 32 additions and 0 deletions

View File

@@ -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,
}
);

View File

@@ -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)) {