Skip to content

Commit

Permalink
fix: creation form holds correctly the networks of the user
Browse files Browse the repository at this point in the history
  • Loading branch information
dlv237 committed Jul 8, 2024
1 parent 9b905c3 commit 1892898
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions my-app/src/components/form/contact_form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default function ContactForm({
console.log("handleSocialMediaTypeChange - selectedOptions:", selectedOptions);
};

const handleSocialMediaHandleChange = (index: number, value: string) => {
const handleSocialMediaChange = (index: number, value: string) => {
const newSocialMedia = [...socialMedia];
newSocialMedia[index].handle = value;
setSocialMedia(newSocialMedia);
Expand Down Expand Up @@ -135,7 +135,7 @@ export default function ContactForm({
}}
/>
<div style={{ display: "flex" }}>
<input style={{ maxWidth: "150px" }} type="text" placeholder="@tu_red_social" value={sm.handle} onChange={(e) => handleSocialMediaHandleChange(index, e.target.value)} />
<input style={{ maxWidth: "150px" }} type="text" placeholder="@tu_red_social" value={sm.handle} onChange={(e) => handleSocialMediaChange(index, e.target.value)} />
<button onClick={() => handleRemoveSocialMedia(index)}>&times;</button>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions my-app/src/pages/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ export default function Create() {
console.log(savedData.selectedOptions);
for (let i = 0; i < savedData.socialMedia.length; i++) {
const dataNetwork = {
social_type: savedData.selectedOptions[i],
social_media: savedData.socialMedia[i],
social_type: savedData.socialMedia[i].type,
social_media: savedData.socialMedia[i].handle,
};

await fetch(`/api/architect/${architect.id}/network`, {
Expand Down

0 comments on commit 1892898

Please sign in to comment.