made country input tag to show country but returns country code as value

This commit was merged in pull request #62.
This commit is contained in:
victorAnumudu
2023-01-25 14:23:11 +01:00
parent e2bc8b517e
commit 40caafdeb5
+3 -7
View File
@@ -117,14 +117,10 @@ const Main = ({ brdcum }) => {
//CALLS THE API AFTER COMPONENT LOADS
useEffect(() => {
allCountry().then((data) => setCountries(Object.keys(data.data))).catch((err)=>console.log(err.message));
allCountry().then((data) => setCountries(Object.entries(data.data))).catch((err)=>console.log(err.message));
}, []);
// useEffect(() => {
// myData
// }, [myData]);
return (
<>
{brdcum.b1 && (
@@ -230,8 +226,8 @@ const Main = ({ brdcum }) => {
countries.map((country, index) => (
<option
key={index}
value={country}>
{country}
value={country[0]}>
{country[1]}
</option>
))}
</select>