From cee46b626306c869092644522677d03ef0115da3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=EC=9E=A5=EB=8F=99=EA=B7=A0?=
<57230590+dongkyun-dev@users.noreply.github.com>
Date: Sat, 24 Feb 2024 13:41:29 +0900
Subject: [PATCH] =?UTF-8?q?[Fix/BAR-270]=20=EA=B3=84=EC=A0=95=EC=84=A4?=
=?UTF-8?q?=EC=A0=95=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=97=B0=EB=8F=99=20?=
=?UTF-8?q?(#90)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* fix: 계정설정
* refactor: 사용하지 않는 TODO 제거
---
pages/main/index.tsx | 2 ++
pages/profile/index.tsx | 17 +++++++++++++++--
src/api/http.ts | 9 +++++++--
.../components/ExitModal/index.tsx" | 14 ++++++++++++--
.../components/Form/index.tsx" | 6 ++++++
.../mutations/useExitAccount.ts" | 5 ++---
.../queries/useGetProfile.ts" | 2 +-
7 files changed, 45 insertions(+), 10 deletions(-)
diff --git a/pages/main/index.tsx b/pages/main/index.tsx
index 48a5d16d..005ce896 100644
--- a/pages/main/index.tsx
+++ b/pages/main/index.tsx
@@ -3,6 +3,7 @@ import { useRouter, useSearchParams } from 'next/navigation';
import Layout from '@components/Layout';
import MainPageTab from '@components/Layout/MainPageTab';
import { ROUTES } from '@constants/routes';
+import useGetProfile from '@domain/계정설정/queries/useGetProfile';
import WriteTabContent from '@domain/끄적이는/components/WriteTabContent';
import 참고하는TabContent from '@domain/참고하는/components';
import useGetMyProfile from '@queries/useGetMyProfile';
@@ -15,6 +16,7 @@ const MainPage = () => {
const selectedTab = searchParams.get('tab') || 'write';
useGetMyProfile();
+ useGetProfile();
const handleTabSelect = (selectedTab: string) => {
router.push(`${ROUTES.MAIN}?tab=${selectedTab}`);
diff --git a/pages/profile/index.tsx b/pages/profile/index.tsx
index 9a1baea0..665fcc8b 100644
--- a/pages/profile/index.tsx
+++ b/pages/profile/index.tsx
@@ -1,8 +1,11 @@
import Image from 'next/image';
+import { useRouter } from 'next/navigation';
import { type ChangeEvent, useMemo, useState } from 'react';
+import Cookies from 'js-cookie';
import Icon from '@components/Icon';
import Layout from '@components/Layout';
+import { ROUTES } from '@constants/routes';
import ExitModal from '@domain/계정설정/components/ExitModal';
import ProfileForm from '@domain/계정설정/components/Form';
import * as styles from '@domain/계정설정/index.css';
@@ -10,8 +13,10 @@ import useExitAccount from '@domain/계정설정/mutations/useExitAccount';
import useUpdateProfileImage from '@domain/계정설정/mutations/useUpdateProfileImage';
import useGetProfile from '@domain/계정설정/queries/useGetProfile';
import useModal from '@hooks/useModal';
+import { STORAGE_KEY } from '@models/storage';
const ProfilePage = () => {
+ const router = useRouter();
const my = useGetProfile();
const exitModalProps = useModal();
const { mutate: exitAccount } = useExitAccount();
@@ -113,8 +118,16 @@ const ProfilePage = () => {
email={my.email}
/>
- {/* TODO: 로그아웃 연결 */}
-
+