Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions frontend/src/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,14 @@ const Login = () => {

return (
<div className={styles.login_container}>
<div className={styles.login}>
<div
className={styles.login}
onKeyDown={(e) => {
if (e.key === "Enter" && name && password) {
handleLogin();
}
}}
>
<h1 className={styles.pirocheck}>PIROCHECK</h1>

<InputBlock
Expand All @@ -71,7 +78,7 @@ const Login = () => {
placeholder: "비밀번호",
},
]}
values={[name, password]} // InputBlock props 수정에 따라 추가
values={[name, password]}
onChange={handleChange}
/>
<div className={styles.errorWrapper}>
Expand Down
26 changes: 20 additions & 6 deletions frontend/src/components/TaskModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,32 @@ 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);
const response = await Promise.all(requests);
console.log("응답들: ", response);
alert("과제가 저장되었습니다.");
onClose();
} catch (error) {
Expand Down