error added

This commit is contained in:
Samandar Turgunboyev
2025-12-11 18:42:32 +05:00
3 changed files with 52 additions and 4 deletions

View File

@@ -64,10 +64,15 @@ export default function AddDistrict({ initialValues, setDialogOpen }: Props) {
const messageText = errMessage.message;
const errMessageName = err.response?.data as { data: { name: [string] } };
const messageTextName = errMessageName.data.name[0];
toast.error(messageTextName || messageText || "Xatolik yuz berdi", {
richColors: true,
position: "top-center",
});
toast.error(
(messageTextName && "Bu tuman oldin qo'shilgan") ||
messageText ||
"Xatolik yuz berdi",
{
richColors: true,
position: "top-center",
},
);
},
});