debug error on profile edit (in server)
This commit is contained in:
parent
9164a1058d
commit
95008f49e6
|
|
@ -65,11 +65,10 @@ function JKEditProfile() {
|
|||
setCurrentUserLoaded(true);
|
||||
fetchCurentUser().then(data => {
|
||||
console.log("userData", data)
|
||||
//setUserData(data);
|
||||
updateUserData(data);
|
||||
fetchInstruments();
|
||||
fetchGenres();
|
||||
//fetchCountries();
|
||||
fetchCountries();
|
||||
});
|
||||
}
|
||||
}, [currentUser]);
|
||||
|
|
@ -329,6 +328,7 @@ function JKEditProfile() {
|
|||
};
|
||||
|
||||
const handleRegionChange = selectedOpt => {
|
||||
if (!selectedOpt) return;
|
||||
if (skipRegionChange.current) {
|
||||
skipRegionChange.current = false;
|
||||
return;
|
||||
|
|
@ -344,6 +344,7 @@ function JKEditProfile() {
|
|||
};
|
||||
|
||||
const handleCityChange = selectedOpt => {
|
||||
if (!selectedOpt) return;
|
||||
const city = selectedOpt.value;
|
||||
setValue('city', city);
|
||||
handleChange();
|
||||
|
|
@ -464,31 +465,30 @@ function JKEditProfile() {
|
|||
<FormGroup>
|
||||
<Label for="country">{t('country')}</Label>
|
||||
{countries.length > 0 && (
|
||||
<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 };
|
||||
// })}
|
||||
// />
|
||||
// );
|
||||
// }}
|
||||
// />
|
||||
<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>
|
||||
<Col md={4}>
|
||||
<FormGroup>
|
||||
<Label for="state">{t('state')}</Label>
|
||||
{regions.length > 0 && (
|
||||
|
||||
<Controller
|
||||
name="state"
|
||||
control={control}
|
||||
|
|
@ -496,17 +496,17 @@ function JKEditProfile() {
|
|||
const region = regions.find(region => region.region === value);
|
||||
return (
|
||||
<Select
|
||||
value={{ value: region.region, label: region.region }}
|
||||
value={{ value: region?.region, label: region?.region }}
|
||||
ref={regionRef}
|
||||
onChange={handleRegionChange}
|
||||
options={regions.map(region => {
|
||||
return { value: region.region, label: region.region };
|
||||
return { value: region?.region, label: region?.region };
|
||||
})}
|
||||
/>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
</FormGroup>
|
||||
</Col>
|
||||
<Col md={4}>
|
||||
|
|
|
|||
Loading…
Reference in New Issue