diff --git a/src/core/components/Toasts/error.jsx b/src/core/components/Toasts/error.jsx index ca503f6..ffd0da2 100644 --- a/src/core/components/Toasts/error.jsx +++ b/src/core/components/Toasts/error.jsx @@ -214,3 +214,31 @@ export const errorClientToast = (toastContainer) => draggable: false, } ); + +export const errorMaxLengthToast = (toastContainer) => + toast.error( + () => ( + + + + + {"حجم درخواست بیشتر از حد مجاز است."} + + + + ), + { + icon: false, + containerId: toastContainer, + autoClose: false, + closeOnClick: false, + draggable: false, + } + ); diff --git a/src/core/utils/errorResponse.js b/src/core/utils/errorResponse.js index 160ac57..6b02157 100644 --- a/src/core/utils/errorResponse.js +++ b/src/core/utils/errorResponse.js @@ -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)) {