Skip to content

Commit b8da5aa

Browse files
authored
Merge pull request #168 from pirogramming/frontend_th
Frontend th
2 parents 63ac104 + f9850f8 commit b8da5aa

File tree

2 files changed

+29
-8
lines changed

2 files changed

+29
-8
lines changed

frontend/src/Login.jsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@ const Login = () => {
5757

5858
return (
5959
<div className={styles.login_container}>
60-
<div className={styles.login}>
60+
<div
61+
className={styles.login}
62+
onKeyDown={(e) => {
63+
if (e.key === "Enter" && name && password) {
64+
handleLogin();
65+
}
66+
}}
67+
>
6168
<h1 className={styles.pirocheck}>PIROCHECK</h1>
6269

6370
<InputBlock
@@ -71,7 +78,7 @@ const Login = () => {
7178
placeholder: "비밀번호",
7279
},
7380
]}
74-
values={[name, password]} // InputBlock props 수정에 따라 추가
81+
values={[name, password]}
7582
onChange={handleChange}
7683
/>
7784
<div className={styles.errorWrapper}>

frontend/src/components/TaskModal.jsx

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,32 @@ const TaskModal = ({ weekInfo, onClose }) => {
1818
};
1919

2020
const handleSave = async () => {
21-
const requests = taskList.map((task, index) =>
22-
api.post("/admin/assignment/signup", {
21+
console.log("save clicked");
22+
23+
const weekNumber = parseInt(weekInfo.week.replace("주차", "")); // 주차 숫자 정보만 추출
24+
const filteredTasks = taskList.filter((t) => t.trim() !== ""); // 빈 값 제거
25+
26+
const requests = filteredTasks.map((task, index) => {
27+
console.log("sending:", {
28+
subject: topic,
29+
assignmentName: task,
30+
week: weekNumber,
31+
day: day,
32+
orderNumber: index + 1,
33+
});
34+
35+
return api.post("/admin/assignment/signup", {
2336
subject: topic,
2437
assignmentName: task,
25-
week: parseInt(weekInfo.week),
38+
week: weekNumber,
2639
day: day,
2740
orderNumber: index + 1,
28-
})
29-
);
41+
});
42+
});
3043

3144
try {
32-
await Promise.all(requests);
45+
const response = await Promise.all(requests);
46+
console.log("응답들: ", response);
3347
alert("과제가 저장되었습니다.");
3448
onClose();
3549
} catch (error) {

0 commit comments

Comments
 (0)