error fixed

This commit is contained in:
2025-06-23 08:41:50 +05:30
parent 89f2e76f0e
commit 987043152c

View File

@@ -218,8 +218,11 @@ export default function ClaimsPage() {
// selenium pdf download handler // selenium pdf download handler
const handleSeleniumPopup = async (actionType: string) => { const handleSeleniumPopup = async (actionType: string) => {
try { try {
if (!claimRes?.id || !selectedPatient) { if (!claimRes?.id) {
throw new Error("Missing claim or patient selection"); throw new Error("Missing claimId");
}
if (!selectedPatient) {
throw new Error("Missing patientId");
} }
const res = await apiRequest("POST", "/api/claims/selenium/fetchpdf", { const res = await apiRequest("POST", "/api/claims/selenium/fetchpdf", {
action: actionType, action: actionType,
@@ -234,6 +237,7 @@ export default function ClaimsPage() {
}); });
setIsMhPopupOpen(false); setIsMhPopupOpen(false);
setSelectedPatient(null);
} catch (error: any) { } catch (error: any) {
toast({ toast({
title: "Error", title: "Error",
@@ -371,7 +375,6 @@ export default function ClaimsPage() {
const closeClaim = () => { const closeClaim = () => {
setIsClaimFormOpen(false); setIsClaimFormOpen(false);
setSelectedPatient(null);
setClaimFormData({ setClaimFormData({
patientId: null, patientId: null,
serviceDate: "", serviceDate: "",