From 994e7c341106a31c84d4f073cd571e8ab7a652b5 Mon Sep 17 00:00:00 2001 From: dlv237 Date: Mon, 19 Aug 2024 22:49:50 -0400 Subject: [PATCH] fix: experience option selection in edit view (placeholder matches the experience id of the architect) --- my-app/src/pages/edit.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/my-app/src/pages/edit.tsx b/my-app/src/pages/edit.tsx index 66cab22..81989c0 100644 --- a/my-app/src/pages/edit.tsx +++ b/my-app/src/pages/edit.tsx @@ -18,9 +18,9 @@ export default function Edit() { const { user } = useUser(); const correoArquitecto = user?.emailAddresses[0]?.emailAddress || "usuario sin correo"; - const [architect, setArchitect] = useState({ Name: '', City: '', Phone: '', id: 0, website: '', address: '', experience: 0, description: ''}); + const [architect, setArchitect] = useState({ Name: '', City: '', Phone: '', id: 0, website: '', address: '', description: ''}); const [cityName, setCityName] = useState(""); - const [experience, setExperience] = useState(architect.experience); + const [experience, setExperience] = useState(""); const [scales, setScales] = useState(Array()); const [isDropdownOpen, setIsDropdownOpen] = useState(false); const [isSocialDropdownOpen, setIsSocialDropdownOpen] = useState(false); @@ -138,9 +138,9 @@ export default function Edit() { const architectData = architects.find((arch: any) => arch.email === correoArquitecto); if (architectData) { - setArchitect({ Name: architectData.name, City: architectData.city, Phone: architectData.phone, id: architectData.id, website: architectData.website, address: architectData.address, experience: architectData.experience, description: architectData.description}); + setArchitect({ Name: architectData.name, City: architectData.city, Phone: architectData.phone, id: architectData.id, website: architectData.website, address: architectData.address, description: architectData.description}); setCityName(architectData.city); - setExperience(architectData.experience); + setExperience(architectData.experience_id.toString()); setPhone(architectData.phone); setName(architectData.name); setWebsite(architectData.website); @@ -218,7 +218,7 @@ export default function Edit() { phone: phone, name: name, city: cityName, - experience_id: experience, + experience_id: Number(experience), website: website, address: address, description: description, @@ -318,7 +318,7 @@ export default function Edit() {