debug error on profile edit (in server)

This commit is contained in:
Nuwan 2024-03-11 07:50:49 +05:30
parent eb488e374b
commit 23830144d8
1 changed files with 18 additions and 17 deletions

View File

@ -464,23 +464,24 @@ function JKEditProfile() {
<FormGroup>
<Label for="country">{t('country')}</Label>
{countries.length > 0 && (
<Controller
name="country"
control={control}
render={({ field: { onChange, value } }) => {
const country = countries.find(country => country.countrycode === value);
return (
<Select
data-testid="countrySelect"
value={{ value: country.countrycode, label: country.countryname }}
onChange={handleCountryChange}
options={countries.map(country => {
return { value: country.countrycode, label: country.countryname };
})}
/>
);
}}
/>
<div></div>
// <Controller
// name="country"
// control={control}
// render={({ field: { onChange, value } }) => {
// const country = countries.find(country => country.countrycode === value);
// return (
// <Select
// data-testid="countrySelect"
// value={{ value: country.countrycode, label: country.countryname }}
// onChange={handleCountryChange}
// options={countries.map(country => {
// return { value: country.countrycode, label: country.countryname };
// })}
// />
// );
// }}
// />
)}
</FormGroup>
</Col>