From 29163f8c4ab34f45c590db4f71a20535abb13413 Mon Sep 17 00:00:00 2001 From: LimHeeJung Date: Tue, 30 Jul 2024 12:21:50 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9Bfix:=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/RetroListPage.tsx | 6 +----- src/pages/SectionPage.tsx | 27 ++------------------------- 2 files changed, 3 insertions(+), 30 deletions(-) diff --git a/src/pages/RetroListPage.tsx b/src/pages/RetroListPage.tsx index d937438..afe409e 100644 --- a/src/pages/RetroListPage.tsx +++ b/src/pages/RetroListPage.tsx @@ -10,7 +10,6 @@ import Pagination from '@/components/RetroList/Pagination'; import ProgressButton from '@/components/RetroList/ProgressButton'; import Search from '@/components/RetroList/Search'; import ViewButton from '@/components/RetroList/ViewButton'; -import { useCustomToast } from '@/hooks/useCustomToast'; import * as S from '@/styles/RetroList/RetroListPage.style'; const formatDate = (isoDateString: string) => { @@ -25,7 +24,6 @@ const formatDate = (isoDateString: string) => { const RetroListPage = () => { const [data, setData] = useState({ totalCount: 0, nodes: [] }); - const toast = useCustomToast(); const [page, setPage] = useState(Math.ceil(data.totalCount / 10)); const [currentPage, setCurrentPage] = useState(1); const [bookmarkUpdate, setBookmarkUpdate] = useState(false); @@ -58,13 +56,11 @@ const RetroListPage = () => { useEffect(() => { const fetchRetrolist = async () => { - // console.log(query); try { const responseData = await queryGetRetrospective(query); setData(responseData.data); } catch (error) { - // console.error('회고 데이터를 가져오는 도중 오류가 발생했습니다:', error); - toast.error(error); + console.error(error); } }; fetchRetrolist(); diff --git a/src/pages/SectionPage.tsx b/src/pages/SectionPage.tsx index db97820..9469d0f 100644 --- a/src/pages/SectionPage.tsx +++ b/src/pages/SectionPage.tsx @@ -1,9 +1,9 @@ import { useEffect, useState } from 'react'; -import { useLocation, useNavigate } from 'react-router-dom'; +import { useLocation } from 'react-router-dom'; // import { Flex } from '@chakra-ui/react'; import { RetrospectiveData } from '@/api/@types/Retrospectives'; import { sectionData } from '@/api/@types/Section'; -import { TeamMembersData, TemplateNameData } from '@/api/@types/TeamController'; +import { TemplateNameData } from '@/api/@types/TeamController'; import { UserData } from '@/api/@types/Users'; import { RetrospectiveService } from '@/api/services/Retrospectives'; import { SectionServices } from '@/api/services/Section'; @@ -27,21 +27,7 @@ const RetroTeamPage = () => { const [template, setTemplate] = useState(); const [rendering, setRendering] = useState(false); const [user, setUser] = useState(); - const [members, setMembers] = useState([]); const toast = useCustomToast(); - const navigate = useNavigate(); - - const fetchTeamMembers = async () => { - try { - if (teamId) { - const data = await TeamControllerServices.TeamMemberGet({ teamId: teamId, retrospectiveId: retrospectiveId }); - setMembers(data.data); - } - return; - } catch (e) { - toast.error(e); - } - }; const fetchRetrospective = async () => { try { @@ -86,19 +72,10 @@ const RetroTeamPage = () => { fetchRetrospective(); fetchTemplate(); fetchUser(); - fetchTeamMembers(); }, [retro?.description, rendering]); if (!retro) return; if (!user) return; - if (teamId && !members.some(value => value.userId === user.userId)) { - toast.error('회고 보기 권한이 없습니다.'); - navigate('/'); - } - if (!teamId && retro.userId !== user.userId) { - toast.error('회고 보기 권한이 없습니다.'); - navigate('/'); - } return (