diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx
index cc3532a5..1dcf3d26 100644
--- a/frontend/src/App.jsx
+++ b/frontend/src/App.jsx
@@ -14,6 +14,9 @@ import SignUp from './pages/SignUp';
import QuantTradingDashboard from './pages/QuantTradingDashboard';
import BacktestResult from './pages/BacktestResult.jsx';
+import CheckInPage from './components/attendancemanage/qrmanagement/CheckInPage.jsx';
+import QrRenderPage from './components/attendancemanage/qrmanagement/QrRenderPage.jsx';
+
import OAuthSuccess from './pages/OAuthSuccess.jsx';
import Main from './pages/external/Main.jsx';
@@ -62,6 +65,8 @@ function App() {
} />
} />
} />
+ } />
+ } />
diff --git a/frontend/src/components/attendancemanage/RoundDayPicker.jsx b/frontend/src/components/attendancemanage/RoundDayPicker.jsx
index 20b6619b..30e4fdc6 100644
--- a/frontend/src/components/attendancemanage/RoundDayPicker.jsx
+++ b/frontend/src/components/attendancemanage/RoundDayPicker.jsx
@@ -1,18 +1,21 @@
import { useState, useEffect } from 'react';
import styles from '../VerificationModal.module.css';
-
import { DayPicker } from 'react-day-picker';
import 'react-day-picker/style.css';
import { useAttendance } from '../../contexts/AttendanceContext';
const RoundDayPicker = () => {
- const { sessions, selectedSessionId, handleAddRounds, closeAddRoundsModal } =
+ const { selectedSessionId, handleAddRounds, closeAddRoundsModal } =
useAttendance();
- const [selectedRounds, setSelectedRounds] = useState([]);
+ const [selectedDate, setSelectedDate] = useState();
+ const [roundName, setRoundName] = useState('');
+ const [startTime, setStartTime] = useState('');
+ const [endTime, setEndTime] = useState('');
+ const [locationName, setLocationName] = useState('');
+
const today = new Date();
- // ESC 키로 모달을 닫는 기능
useEffect(() => {
const handleKeyDown = (event) => {
if (event.key === 'Escape') {
@@ -21,44 +24,49 @@ const RoundDayPicker = () => {
};
document.addEventListener('keydown', handleKeyDown);
-
return () => {
document.removeEventListener('keydown', handleKeyDown);
};
}, [closeAddRoundsModal]);
- const handleComplete = () => {
- const currentSession = sessions.find(
- (s) => s.attendanceSessionId === selectedSessionId
- );
-
- if (!currentSession) {
+ const handleComplete = async () => {
+ if (!selectedSessionId) {
alert('세션을 먼저 선택해주세요.');
return;
}
- if (selectedRounds.length === 0) {
- alert('추가할 날짜를 1개 이상 선택해주세요.');
+
+ if (
+ !selectedDate ||
+ !roundName ||
+ !startTime ||
+ !endTime ||
+ !locationName
+ ) {
+ alert('모든 항목을 입력해주세요.');
return;
}
- const newRounds = selectedRounds.map((date) => {
- const timeZoneOffset = date.getTimezoneOffset() * 60000;
- const dateWithoutOffset = new Date(date.getTime() - timeZoneOffset);
- const dateString = dateWithoutOffset.toISOString().split('T')[0];
+ // 날짜 문자열 (YYYY-MM-DD)
+ const roundDate = selectedDate.toLocaleDateString('sv-SE');
- return {
- // id: `round-${uuid()}`,
- roundDate: dateString,
- startTime: currentSession.defaultStartTime,
- availableMinutes: currentSession.defaultAvailableMinutes,
- // status: 'opened',
- // participants: [],
- };
- });
+ const startAt = `${roundDate}T${startTime}:00`;
+ const closeAt = `${roundDate}T${endTime}:00`;
- handleAddRounds(selectedSessionId, newRounds);
+ const newRound = {
+ roundDate,
+ startAt,
+ closeAt,
+ roundName,
+ locationName,
+ };
- closeAddRoundsModal();
+ try {
+ await handleAddRounds(selectedSessionId, [newRound]);
+ console.log('새로운 라운드 데이터:', newRound);
+ closeAddRoundsModal();
+ } catch (err) {
+ alert('라운드 생성에 실패했습니다.');
+ }
};
return (
@@ -69,23 +77,48 @@ const RoundDayPicker = () => {
+
+
+
+ setRoundName(e.target.value)}
+ />
+
+ setStartTime(e.target.value)}
+ />
+
+ setEndTime(e.target.value)}
+ />
+
+ setLocationName(e.target.value)}
+ />
+
+
- 세션에 추가하고 싶은 날짜를 선택하세요.
- (출석 시작 시간 & 인정 시간은 세션의 디폴트 값으로 설정됨)