fix(api): suppress toast notifications on handled 404 responses

This commit is contained in:
parsa aghaei committed 2026-08-03 11:30:00 +03:30
1 parent f22238d6c7
commit 6b566e9a51
1 file changed
+2 -2
+2 -2
View File
@@ -57,8 +57,8 @@ api.interceptors.response.use(
}
}
// Show formatted Farsi toast if not explicitly suppressed
if (!error.config?.hideErrorToast) {
// Show formatted Farsi toast if not explicitly suppressed and not 404
if (!error.config?.hideErrorToast && status !== 404) {
if (responseData?.details && Array.isArray(responseData.details) && responseData.details.length > 0) {
const firstDetailMessage = responseData.details[0]?.message || farsiMessage;
toast.error(firstDetailMessage);