diff --git a/components/dashboard/userAccount/detailUser/information/form/index.js b/components/dashboard/userAccount/detailUser/information/form/index.js index 7066c94..7e822b9 100644 --- a/components/dashboard/userAccount/detailUser/information/form/index.js +++ b/components/dashboard/userAccount/detailUser/information/form/index.js @@ -74,9 +74,7 @@ function Form({ insurance, errors, changeData, information }) { - changeData(data === "زن" ? "female" : "male", name) - } + updateData={(name, option) => changeData(option?.id ?? "", name)} value={findVal(gender, "gender")} label="جنسیت" name="gender" @@ -143,9 +141,7 @@ function Form({ insurance, errors, changeData, information }) { - changeData(blood_group.find((g) => g.label === value)?.id ?? "", name) - } + updateData={(name, option) => changeData(option?.id ?? "", name)} value={findVal(blood_group, "blood_type")} label="گروه خونی" name="blood_type" @@ -155,9 +151,7 @@ function Form({ insurance, errors, changeData, information }) { - changeData(value === "متاهل" ? "married" : "single", name) - } + updateData={(name, option) => changeData(option?.id ?? "", name)} value={findVal(marital_status, "marital_status")} label="وضعیت تاهل" name="marital_status" @@ -177,9 +171,7 @@ function Form({ insurance, errors, changeData, information }) { - changeData(education.find((g) => g.label === value)?.id ?? "", name) - } + updateData={(name, option) => changeData(option?.id ?? "", name)} value={findVal(education, "education")} label="تحصیلات" name="education" @@ -189,9 +181,7 @@ function Form({ insurance, errors, changeData, information }) { - changeData(value === "آزاد" ? "azad" : "dolati", name) - } + updateData={(name, option) => changeData(option?.id ?? "", name)} value={findVal(job, "job")} label="شغل" name="job"