From b9b7c12bb5152f07862ee7730adfd565563b339d Mon Sep 17 00:00:00 2001 From: namdaeun Date: Wed, 17 Jan 2024 22:05:42 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20groupId=20=ED=94=BD=EC=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/groupFeed/components/MyGroupBtn.tsx | 6 ++---- src/pages/main/apis/getGroupContent.ts | 5 ++--- src/pages/main/components/GroupContent.tsx | 17 ++++++++++------- src/pages/main/components/MainHeader.tsx | 8 +++----- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/pages/groupFeed/components/MyGroupBtn.tsx b/src/pages/groupFeed/components/MyGroupBtn.tsx index 839e3e5b..2841ee15 100644 --- a/src/pages/groupFeed/components/MyGroupBtn.tsx +++ b/src/pages/groupFeed/components/MyGroupBtn.tsx @@ -1,12 +1,10 @@ import styled from '@emotion/styled'; import { useNavigate } from 'react-router-dom'; -import { groupPropTypes } from '../../main/apis/getGroupContent'; - -const MyGroupBtn = ({ moimId }: groupPropTypes) => { +const MyGroupBtn = () => { const navigate = useNavigate(); const handleRoutingGroupFeed = () => { - navigate(`/group/${moimId}`); + navigate(`/group/MQ==`); }; return 내 글 모임; diff --git a/src/pages/main/apis/getGroupContent.ts b/src/pages/main/apis/getGroupContent.ts index ae87267d..1a86f414 100644 --- a/src/pages/main/apis/getGroupContent.ts +++ b/src/pages/main/apis/getGroupContent.ts @@ -4,8 +4,8 @@ import { client } from '../../../utils/apis/axios'; export interface groupPropTypes { moimId: string; - moimName: string; - moimPosts: groupPostTypes[]; + moimName?: string; + moimPosts?: groupPostTypes[]; } interface getGroupContentResponseTypes { @@ -19,7 +19,6 @@ interface getGroupContentResponseTypes { export const getGroupContent = async () => { try { const { data } = await client.get('/api/moim/best'); - console.log(data.data.moim); return data.data.moim; } catch (error) { console.error(error); diff --git a/src/pages/main/components/GroupContent.tsx b/src/pages/main/components/GroupContent.tsx index ea88b507..5f639b7e 100644 --- a/src/pages/main/components/GroupContent.tsx +++ b/src/pages/main/components/GroupContent.tsx @@ -3,8 +3,6 @@ import { useNavigate } from 'react-router-dom'; import CuriousGroup from './CuriousGroup'; -import { groupPropTypes } from '../apis/getGroupContent'; - import Spacing from './.././../../components/commons/Spacing'; export interface groupContentPropTypes { @@ -17,13 +15,18 @@ export interface groupContentPropTypes { isLast: boolean; } -const GroupContent = ( - { topicName, imageUrl, postTitle, postContent, groupId, postId, isLast }: groupContentPropTypes, - { moimId }: groupPropTypes, -) => { +const GroupContent = ({ + topicName, + imageUrl, + postTitle, + postContent, + groupId, + postId, + isLast, +}: groupContentPropTypes) => { const navigate = useNavigate(); const handleOnClick = () => { - navigate(`/detail/${moimId}/${postId}`); + navigate(`/detail/${groupId}/${postId}`); }; const hasImage = () => { return imageUrl !== null; diff --git a/src/pages/main/components/MainHeader.tsx b/src/pages/main/components/MainHeader.tsx index 85a603ff..b492337c 100644 --- a/src/pages/main/components/MainHeader.tsx +++ b/src/pages/main/components/MainHeader.tsx @@ -1,8 +1,6 @@ import styled from '@emotion/styled'; import { useNavigate } from 'react-router-dom'; -import { groupPropTypes } from '../apis/getGroupContent'; - import { HeaderLogoIc } from '../../../assets/svgs'; import LogInOutBtn from '../../../components/commons/LogInOutBtn'; import theme from '../../../styles/theme'; @@ -11,18 +9,18 @@ import MakeGroupBtn from '../../groupFeed/components/MakeGroupBtn'; import MyGroupBtn from '../../groupFeed/components/MyGroupBtn'; // 메인 페이지 헤더 -export const LogInHeader = ({ moimId, moimName, moimPosts }: groupPropTypes) => { +export const LogInHeader = () => { const handleLogOut = () => { logout(); alert('로그아웃 되었습니다'); location.reload(); }; - + //MQ== return ( - + 로그아웃