From c34199315a1acefd74be4431a01ba5bb199e9fa7 Mon Sep 17 00:00:00 2001 From: jin-co Date: Fri, 1 Sep 2023 08:20:18 +0900 Subject: [PATCH] Update --- React/test-housing/src/pages/CreateListing.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/React/test-housing/src/pages/CreateListing.js b/React/test-housing/src/pages/CreateListing.js index 75313c42f..cfca1fa68 100644 --- a/React/test-housing/src/pages/CreateListing.js +++ b/React/test-housing/src/pages/CreateListing.js @@ -44,6 +44,8 @@ export const CreateListing = () => { const navigate = useNavigate() const onMutate = (e) => { + console.log(e.target) + console.log(e.target.files) if (e.target.value === 'false') { setFormData((prev) => ({ ...prev, @@ -54,6 +56,11 @@ export const CreateListing = () => { ...prev, [e.target.id]: true })) + } else if (e.target.files) { + setFormData((prev) => ({ + ...prev, + images: e.target.files + })) } else { setFormData((prev) => ({ ...prev, @@ -98,14 +105,14 @@ export const CreateListing = () => { ).catch(() => { return }) - + console.log('imageUrls: ', imageUrls) let geolocation = {} if (geolocationEnabled) { } else { geolocation.lat = latitude geolocation.log = longitude - } + } const formDataCopy = { ...formData,