From 580a01d4d7334665d7af9cd8dfacdfd8c92eb9d3 Mon Sep 17 00:00:00 2001 From: NamKyeongMin Date: Thu, 22 May 2025 16:04:36 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[fix]:=20ManagaTask.jsx=20save=5Fbtn=20?= =?UTF-8?q?=ED=95=B8=EB=93=A4=EB=A7=81=20=EC=B2=98=EB=A6=AC=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/TaskModal.jsx | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/TaskModal.jsx b/frontend/src/components/TaskModal.jsx index a1d9879..7bac438 100644 --- a/frontend/src/components/TaskModal.jsx +++ b/frontend/src/components/TaskModal.jsx @@ -18,15 +18,28 @@ const TaskModal = ({ weekInfo, onClose }) => { }; const handleSave = async () => { - const requests = taskList.map((task, index) => - api.post("/admin/assignment/signup", { + console.log("save clicked"); + + const weekNumber = parseInt(weekInfo.week.replace("주차", "")); // 주차 숫자 정보만 추출 + const filteredTasks = taskList.filter((t) => t.trim() !== ""); // 빈 값 제거 + + const requests = filteredTasks.map((task, index) => { + console.log("sending:", { + subject: topic, + assignmentName: task, + week: weekNumber, + day: day, + orderNumber: index + 1, + }); + + return api.post("/admin/assignment/signup", { subject: topic, assignmentName: task, - week: parseInt(weekInfo.week), + week: weekNumber, day: day, orderNumber: index + 1, - }) - ); + }); + }); try { await Promise.all(requests); From f14a4921e4a3932aacae517ce5577da7faa7ccae Mon Sep 17 00:00:00 2001 From: NamKyeongMin Date: Thu, 22 May 2025 16:32:32 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[fix]:=20ManagaTask.jsx=20save=5Fbtn=20?= =?UTF-8?q?=ED=95=B8=EB=93=A4=EB=A7=81=20=EC=B2=98=EB=A6=AC=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/TaskModal.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/TaskModal.jsx b/frontend/src/components/TaskModal.jsx index 7bac438..a2e7a42 100644 --- a/frontend/src/components/TaskModal.jsx +++ b/frontend/src/components/TaskModal.jsx @@ -42,7 +42,8 @@ const TaskModal = ({ weekInfo, onClose }) => { }); try { - await Promise.all(requests); + const response = await Promise.all(requests); + console.log("응답들: ", response); alert("과제가 저장되었습니다."); onClose(); } catch (error) { From f9850f833fad28b330d3b6fe316b262642ca5fae Mon Sep 17 00:00:00 2001 From: qkrxogmla Date: Thu, 22 May 2025 16:47:29 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=EC=97=94=ED=84=B0=EC=8B=9C=20=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=EC=9D=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/Login.jsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/src/Login.jsx b/frontend/src/Login.jsx index 58f63b1..4690e4d 100644 --- a/frontend/src/Login.jsx +++ b/frontend/src/Login.jsx @@ -57,7 +57,14 @@ const Login = () => { return (
-
+
{ + if (e.key === "Enter" && name && password) { + handleLogin(); + } + }} + >

PIROCHECK

{ placeholder: "비밀번호", }, ]} - values={[name, password]} // InputBlock props 수정에 따라 추가 + values={[name, password]} onChange={handleChange} />