diff --git a/backend/pirocheck/src/main/resources/application.yml b/backend/pirocheck/src/main/resources/application.yml index bdef4aa..8d44732 100644 --- a/backend/pirocheck/src/main/resources/application.yml +++ b/backend/pirocheck/src/main/resources/application.yml @@ -17,7 +17,7 @@ server: session: cookie: http-only: true # 세션 쿠키를 HttpOnly로 설정 (JS에서 접근 불가) - secure: false # HTTPS 전용 전송 (Https -> true로 바꿔야 함) + secure: true # HTTPS 전용 전송 (Https -> true로 바꿔야 함) same-site: Lax # CSRF 방지 timeout: 30m # 세션 타임아웃 30분 (30 minutes) address: 0.0.0.0 diff --git a/frontend/src/api/api.js b/frontend/src/api/api.js index 1950026..c2c9d61 100644 --- a/frontend/src/api/api.js +++ b/frontend/src/api/api.js @@ -1,7 +1,7 @@ import axios from "axios"; const api = axios.create({ - baseURL: "http://api.pirocheck.org:8080/api", + baseURL: "https://api.pirocheck.org/api", // 수정 필요한지 재검 필요함 // "http://api.pirocheck.org:8080/api" withCredentials: true, diff --git a/frontend/src/api/user.js b/frontend/src/api/user.js index 12e057a..3309ca5 100644 --- a/frontend/src/api/user.js +++ b/frontend/src/api/user.js @@ -1,5 +1,5 @@ export const loginUser = async ({ name, password }) => { - const res = await fetch("http://api.pirocheck.org:8080/api/login", { + const res = await fetch("https://api.pirocheck.org/api/login", { method: "POST", headers: { "Content-Type": "application/json", diff --git a/frontend/src/pages/admin/AdminStudentAssignment.jsx b/frontend/src/pages/admin/AdminStudentAssignment.jsx index c29c35e..fd2d088 100644 --- a/frontend/src/pages/admin/AdminStudentAssignment.jsx +++ b/frontend/src/pages/admin/AdminStudentAssignment.jsx @@ -42,7 +42,7 @@ const AdminStudentAssignment = () => { id: task.id, label: task.assignmentName, status: task.status, - //modified: false, + modified: false, })), })), })); @@ -64,21 +64,22 @@ const AdminStudentAssignment = () => { }); }, [studentId, week]); - const handleStatusChange = (weekIdx, dayIdx, taskIdx, newStatus) => { - const updated = [...weeks]; - const task = updated[weekIdx].days[dayIdx].tasks[taskIdx]; - task.status = newStatus; - task.modified = true; - setWeeks(updated); - }; - /* - const handleSave = async (taskId, status) => { - await api.put("/admin/assignment/status", { - assignmentId: taskId, - status, - }); + const handleStatusChange = (taskId, newStatus) => { + const updatedWeeks = weeks.map((weekItem) => ({ + ...weekItem, + days: weekItem.days.map((dayItem) => ({ + ...dayItem, + tasks: dayItem.tasks.map((task) => + task.id === taskId + ? { ...task, status: newStatus, modified: true } + : task + ), + })), + })); + + setWeeks(updatedWeeks); }; -*/ + const handleSave = async (taskId, status) => { @@ -134,8 +135,6 @@ const AdminStudentAssignment = () => { value={task.status} onChange={(e) => handleStatusChange( - weekIdx, - dayIdx, taskIdx, e.target.value ) diff --git a/frontend/vite.config.js b/frontend/vite.config.js index 26f670c..6fe408f 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -7,7 +7,7 @@ export default defineConfig({ server: { proxy: { "/api": { - target: "http://api.pirocheck.org:8080/api", + target: "https://api.pirocheck.org/api", changeOrigin: true, }, },