update: inquiry toast errors

This commit is contained in:
2026-02-08 09:20:18 +03:30
parent e51f998a91
commit f53021aca3
4 changed files with 12 additions and 31 deletions

View File

@@ -78,7 +78,7 @@ interface InquiryFarmResponse {
const VeterinaryTransfer: React.FC = () => {
const [trIDCode, setTrIDCode] = useState("");
const [transferData, setTransferData] = useState<VeterinaryTransferItem[]>(
[]
[],
);
const [farmInfoByPartId, setFarmInfoByPartId] = useState<
Record<string, InquiryFarmResponse | null>
@@ -117,11 +117,7 @@ const VeterinaryTransfer: React.FC = () => {
}
} catch (error: any) {
console.error("Veterinary transfer error:", error);
showToast(
error?.response?.data?.message ||
"خطا در دریافت اطلاعات گواهی بهداشتی حمل",
"error"
);
showToast("خطا در دریافت اطلاعات گواهی بهداشتی حمل", "error");
setTransferData([]);
}
};
@@ -145,10 +141,7 @@ const VeterinaryTransfer: React.FC = () => {
}
} catch (error: any) {
console.error("Inquiry farm error:", error);
showToast(
error?.response?.data?.message || "خطا در استعلام واحد کشاورزی",
"error"
);
showToast("خطا در استعلام واحد کشاورزی", "error");
setFarmInfoByPartId((prev) => ({ ...prev, [code]: null }));
} finally {
setFarmLoadingByPartId((prev) => ({ ...prev, [code]: false }));