From c751b7b25e00780d0d6a5270f4b1ed291f6a96b4 Mon Sep 17 00:00:00 2001 From: parkyejin Date: Thu, 7 Nov 2024 18:05:02 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EA=B0=81=EA=B0=81=EC=9D=98=20=EC=BA=98?= =?UTF-8?q?=EB=A6=B0=EB=8D=94=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/HealthCare/HealthCare.jsx | 77 ++++------------------------- 1 file changed, 10 insertions(+), 67 deletions(-) diff --git a/src/pages/HealthCare/HealthCare.jsx b/src/pages/HealthCare/HealthCare.jsx index 48ef024..4949097 100644 --- a/src/pages/HealthCare/HealthCare.jsx +++ b/src/pages/HealthCare/HealthCare.jsx @@ -110,27 +110,18 @@ const HealthCare = () => { formData.append("notes", memo); } - console.log("formData 내용:", formData); - - // formData를 포함하여 POST 요청 전송 const postResponse = await axios.post("/healths", formData, { headers: { "Content-Type": "application/json", }, }); console.log("등록 data : ", postResponse.data); - alert("등록 성공"); setMemo(""); } catch (error) { console.error("오류 발생:", error); - alert("오류 발생"); } }; - const toggleInput = (type) => { - setShowInput({ ...showInput, [type]: !showInput[type] }); - }; - // 날짜에 따른 캘린더 타일 표시 const tileContent = ({ date, view }) => { if (view === "month") { @@ -211,72 +202,24 @@ const HealthCare = () => { - + addAppointment("병원 방문일", e)}> + 등록 + - {showInput.hospital && ( - - handleDateChange(new Date(e.target.value))} - /> - addAppointment("병원 방문일", e)}> - 등록 - - - )} - + addAppointment("다음 방문일", e)}> + 등록 + - {showInput.nextVisit && ( - - handleDateChange(new Date(e.target.value))} - /> - addAppointment("다음 방문일", e)}> - 등록 - - - )} - + + addAppointment("건강 관리", e)}> + 등록 + - {showInput.healthCare && ( - - handleDateChange(new Date(e.target.value))} - /> - setMemo(e.target.value)} - /> - addAppointment("건강 관리", e)}> - 등록 - - - )} - - {appointments.map((appointment, index) => ( - - {appointment.type} - {appointment.date.toLocaleDateString()} - {appointment.memo && ( - - 메모: {appointment.memo} - )} - - ))} - ); };