diff --git a/.github/workflows/stagGitAction.yml b/.github/workflows/stagGitAction.yml index 5f900e8..723b832 100644 --- a/.github/workflows/stagGitAction.yml +++ b/.github/workflows/stagGitAction.yml @@ -1,4 +1,4 @@ -name: Deploy +name: stagDeploy on: push: diff --git a/src/api/type.ts b/src/api/type.ts index 0cbe1d9..a69fe56 100644 --- a/src/api/type.ts +++ b/src/api/type.ts @@ -87,6 +87,8 @@ export interface AfterStudent { status1: string; status2: string; status3: string; + status4: string; + status5: string; } export interface ChangeClub { diff --git a/src/app/afterManage/page.tsx b/src/app/afterManage/page.tsx index f3cf8ac..8350124 100644 --- a/src/app/afterManage/page.tsx +++ b/src/app/afterManage/page.tsx @@ -40,7 +40,13 @@ const AfterManage = () => { const parsedData = JSON.parse(localData); const studentData = { user_id: item.id, - status_list: [parsedData[0], parsedData[1], parsedData[2]], + status_list: [ + parsedData[0], + parsedData[1], + parsedData[2], + parsedData[3], + parsedData[4], + ], }; updatedData.push(studentData); } @@ -139,6 +145,15 @@ const AfterManage = () => { } }, [getClub]); + useEffect(() => { + const keys = Object.keys(localStorage); + keys.forEach((key) => { + if (key.includes("-")) { + localStorage.removeItem(key); + } + }); + }, [selectClub]); + const handleClubChange = (selectedOption: string) => { setSelectClub(selectedOption); }; @@ -203,6 +218,8 @@ const AfterManage = () => { state1={item.status6} state2={item.status7} state3={item.status8} + state4={item.status9} + state5={item.status10} /> )) ) : ( @@ -220,6 +237,8 @@ const AfterManage = () => { state1={item.status1} state2={item.status2} state3={item.status3} + state4={item.status4} + state5={item.status5} name={`${setStudentNum(item)} ${item.name}`} onClick={() => handleAcceptListClick(item.id, item.name) diff --git a/src/app/attendanceCheck/page.tsx b/src/app/attendanceCheck/page.tsx index 3c13b87..5184142 100644 --- a/src/app/attendanceCheck/page.tsx +++ b/src/app/attendanceCheck/page.tsx @@ -56,7 +56,13 @@ const attendanceCheck = () => { const parsedData = JSON.parse(localData); const studentData = { user_id: item.id, - status_list: [parsedData[0], parsedData[1], parsedData[2]], + status_list: [ + parsedData[0], + parsedData[1], + parsedData[2], + parsedData[3], + parsedData[4], + ], }; updatedData.push(studentData); } @@ -123,6 +129,8 @@ const attendanceCheck = () => { state1={item.status6} state2={item.status7} state3={item.status8} + state4={item.status9} + state5={item.status10} after /> ))} diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index 6f54cbf..50fc5e6 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -3,10 +3,10 @@ import Image from "next/image"; import Input from "@/components/input"; import Button from "@/components/button"; import Logo from "@/assets/svg/PiCKLogo.svg"; -import { useState } from "react"; +import { useEffect, useState } from "react"; import { useLogin } from "@/api/login"; import { useRouter } from "next/navigation"; -import { saveToken } from "@/util/auth"; +import { cookie, saveToken } from "@/util/auth"; interface ChangeProps { text: string; @@ -59,6 +59,11 @@ const Login = () => { router.push("/login"); } }; + + useEffect(() => { + cookie.remove("access_token"); + cookie.remove("refresh_token"); + }, []); const BtnColor = () => { if (data.admin_id === "" || data.password === "") { diff --git a/src/app/outAccept/page.tsx b/src/app/outAccept/page.tsx index 386b779..12ace6a 100644 --- a/src/app/outAccept/page.tsx +++ b/src/app/outAccept/page.tsx @@ -125,17 +125,17 @@ const OutAccept = () => { } else setAcModal(true); }; - const onCancel = () => { - setAcModal(false); - setNomodal(false); - }; - const No = () => { if (selectedStudents.length === 0) { alert("외출 거절 할 학생을 선택해주세요"); } else setNomodal(true); }; + const onCancel = () => { + setAcModal(false); + setNomodal(false); + }; + const onClickTab = (tab: boolean) => { setSelectedTab(tab); }; diff --git a/src/components/list/afterManage/index.tsx b/src/components/list/afterManage/index.tsx index 3522dd9..8d53ecc 100644 --- a/src/components/list/afterManage/index.tsx +++ b/src/components/list/afterManage/index.tsx @@ -6,8 +6,8 @@ interface NonReturnProp { state1: string; state2: string; state3: string; - state4?: string; - state5?: string; + state4: string; + state5: string; id: string; onClick?: () => void; after?: boolean; @@ -24,7 +24,6 @@ export const AfterList = ({ time, id, onClick, - after, name, }: NonReturnProp) => { const Change = (item: string) => { @@ -49,7 +48,7 @@ export const AfterList = ({ const [statusList, setStatusList] = useState([]); useEffect(() => { - setStatusList([state1, state2, state3]); + setStatusList([state1, state2, state3, state4, state5]); }, [state1, state2, state3]); useEffect(() => { @@ -63,70 +62,41 @@ export const AfterList = ({ }; const ClassCheck = (newState: string) => { - if (after) { - switch (time) { - case 8: - handleChange(0, newState); - break; - case 9: - handleChange(1, newState); - break; - case 10: - handleChange(2, newState); - break; - default: - break; - } - } else { - switch (time) { - case 6: - handleChange(0, newState); - break; - case 7: - handleChange(1, newState); - break; - case 8: - handleChange(2, newState); - break; - case 9: - handleChange(3, newState); - break; - case 10: - handleChange(4, newState); - break; - default: - break; - } + switch (time) { + case 6: + handleChange(0, newState); + break; + case 7: + handleChange(1, newState); + break; + case 8: + handleChange(2, newState); + break; + case 9: + handleChange(3, newState); + break; + case 10: + handleChange(4, newState); + break; + default: + break; } }; const changeProp = () => { - if (after) { - switch (time) { - case 8: - return state1; - case 9: - return state2; - case 10: - return state3; - default: - return ""; - } - } else { - switch (time) { - case 6: - return state1; - case 7: - return state2; - case 8: - return state3; - case 9: - return state4 || ""; - case 10: - return state5 || ""; - default: - return ""; - } + switch (time) { + case 6: + return state1; + case 7: + return state2; + case 8: + return state3; + case 9: + return state4 || ""; + case 10: + return state5 || ""; + default: + return ""; } };