fix(appointment): ensure national code and gender are mandatory for both self and others in SubmitData component

This commit is contained in:
hamed
2026-06-24 12:33:00 +03:30
parent 57e341b7b3
commit ce07b4d1b1
+3 -2
View File
@@ -139,12 +139,13 @@ function SubmitData({ setStep, data, prevData, setErrors, doctor, isForAnother,
slot_end: selectedSlot.end,
for_self: !isForAnother,
note: data?.patient_reason?.value || "",
// کد ملی و جنسیت در هر دو حالت (خودِ بیمار / شخص دیگر) الزامی است.
patient_national_code: data?.national_code?.value || "",
patient_gender: data?.gender?.value?.id || data?.gender?.value || "",
...(isForAnother
? {
patient_name: [data?.name?.value, data?.family?.value].filter(Boolean).join(" ").trim(),
patient_mobile: data?.phone?.value,
patient_national_code: data?.national_code?.value || "",
patient_gender: data?.gender?.value?.id || data?.gender?.value || "",
patient_reason: data?.patient_reason?.value || "",
}
: {}),