From 95008f49e6d6770320720e84a310ec0d7b367af6 Mon Sep 17 00:00:00 2001 From: Nuwan Date: Mon, 11 Mar 2024 16:38:22 +0530 Subject: [PATCH] debug error on profile edit (in server) --- jam-ui/src/components/page/JKEditProfile.js | 48 ++++++++++----------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/jam-ui/src/components/page/JKEditProfile.js b/jam-ui/src/components/page/JKEditProfile.js index 9296e88e2..a81c4052f 100644 --- a/jam-ui/src/components/page/JKEditProfile.js +++ b/jam-ui/src/components/page/JKEditProfile.js @@ -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() { {countries.length > 0 && ( -
- // { - // const country = countries.find(country => country.countrycode === value); - // return ( - // { + return { value: country.countrycode, label: country.countryname }; + })} + /> + ); + }} + /> )}
- {regions.length > 0 && ( + region.region === value); return (