From 70067a02ec090d6e22bcf5dd2aa1afab11884f29 Mon Sep 17 00:00:00 2001 From: Kim Kangmin Date: Mon, 23 Jun 2025 10:15:03 +0900 Subject: [PATCH 1/6] =?UTF-8?q?feat:=20=EA=B3=84=EC=A0=95=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=EB=B2=84=ED=8A=BC=20=EB=94=94=EC=9E=90=EC=9D=B8=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/account-settings-dialog.tsx | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/features/user/components/account-settings-dialog.tsx b/src/features/user/components/account-settings-dialog.tsx index f8999510..175cbcca 100644 --- a/src/features/user/components/account-settings-dialog.tsx +++ b/src/features/user/components/account-settings-dialog.tsx @@ -1,7 +1,6 @@ 'use client'; import { useState } from 'react'; -import { Button } from '@/components/ui/button'; import { Dialog, DialogContent, @@ -16,7 +15,7 @@ import { ChangePasswordForm } from './account-settings/change-password-form'; * 계정 설정 모달 컴포넌트 * * 계정 설정 모달에서 비밀번호를 변경할 수 있다. - * + * * @returns 계정 설정 모달 컴포넌트 */ export const AccountSettingsDialog = () => { @@ -28,22 +27,25 @@ export const AccountSettingsDialog = () => { return ( <> - - - - - - - 계정 설정 - - 비밀번호를 변경할 수 있습니다. - - -
- -
+ + + + + + + 계정 설정 + + 비밀번호를 변경할 수 있습니다. + + +
+ +
From 410227f5a0a4de4ecdbc04349942ce8724ed178d Mon Sep 17 00:00:00 2001 From: Kim Kangmin Date: Mon, 23 Jun 2025 10:15:30 +0900 Subject: [PATCH 2/6] =?UTF-8?q?feat:=20=ED=9A=8C=EC=9B=90=20=ED=83=88?= =?UTF-8?q?=ED=87=B4=20=EB=B2=84=ED=8A=BC=20=EB=94=94=EC=9E=90=EC=9D=B8=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/features/user/components/withdraw-dialog.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/features/user/components/withdraw-dialog.tsx b/src/features/user/components/withdraw-dialog.tsx index d1cff195..4509faba 100644 --- a/src/features/user/components/withdraw-dialog.tsx +++ b/src/features/user/components/withdraw-dialog.tsx @@ -51,9 +51,9 @@ export const WithdrawDialog = () => { <> - + @@ -63,7 +63,7 @@ export const WithdrawDialog = () => { - 취소 + 취소 탈퇴 From 80d472169c6ce3d58b13ce185226a6e2eff53a09 Mon Sep 17 00:00:00 2001 From: Kim Kangmin Date: Mon, 23 Jun 2025 10:16:01 +0900 Subject: [PATCH 3/6] =?UTF-8?q?feat:=20=EA=B3=84=EC=A0=95=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95,=20=ED=9A=8C=EC=9B=90=20=ED=83=88=ED=87=B4=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/components/current-user-profile.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/features/user/components/current-user-profile.tsx b/src/features/user/components/current-user-profile.tsx index 93dcba47..8bf675a7 100644 --- a/src/features/user/components/current-user-profile.tsx +++ b/src/features/user/components/current-user-profile.tsx @@ -4,9 +4,10 @@ import { Avatar } from '@/components/atoms/avatar'; import useAuthStore from '@/stores/useAuthStore'; import { getSkill } from '@/types/enums'; import { EditUserProfileDialog } from '@/features/user/components/edit-user-profile-dialog'; -// import { AccountSettingsDialog } from '@/features/user/components/account-settings-dialog'; -// import { WithdrawDialog } from '@/features/user/components/withdraw-dialog'; +import { AccountSettingsDialog } from '@/features/user/components/account-settings-dialog'; +import { WithdrawDialog } from '@/features/user/components/withdraw-dialog'; import { getDisplayNickname, getDisplayProfileImage } from '@/utils/fallback'; +import { Separator } from '@/components/ui/separator'; /** * 현재 로그인 한 유저의 프로필 컴포넌트 @@ -37,7 +38,7 @@ export const CurrentUserProfile = () => {
-
+
{getDisplayNickname(nickname, email)} @@ -68,6 +69,11 @@ export const CurrentUserProfile = () => { {email}
+
+ + + +
From 0ff6bd03d3c4a156d836653425ce8d779a30e2e6 Mon Sep 17 00:00:00 2001 From: Kim Kangmin Date: Mon, 23 Jun 2025 10:16:30 +0900 Subject: [PATCH 4/6] =?UTF-8?q?feat:=20=ED=8F=BC=20=EC=8A=A4=ED=82=A4?= =?UTF-8?q?=EB=A7=88=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/account-settings/change-password-form.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/features/user/components/account-settings/change-password-form.tsx b/src/features/user/components/account-settings/change-password-form.tsx index a376935f..43cec2cd 100644 --- a/src/features/user/components/account-settings/change-password-form.tsx +++ b/src/features/user/components/account-settings/change-password-form.tsx @@ -14,7 +14,7 @@ const schema = z.object({ message: '영어 대/소문자, 숫자, 특수문자를 혼합하여 8자리 이상 입력해주세요.', }), - confirmPassword: z + currentPassword: z .string() .nonempty({ message: '기존 비밀번호를 입력해주세요' }), }); @@ -36,7 +36,7 @@ export const ChangePasswordForm = ({ resolver: zodResolver(schema), defaultValues: { newPassword: '', - confirmPassword: '', + currentPassword: '', }, }); @@ -46,7 +46,7 @@ export const ChangePasswordForm = ({ try { await changePassword({ newPassword: data.newPassword, - confirmPassword: data.confirmPassword, + currentPassword: data.currentPassword, }); closeDialog(); } catch (error) { @@ -62,7 +62,7 @@ export const ChangePasswordForm = ({ > From def4a601427317888e142326ffe16c5045e6bcdc Mon Sep 17 00:00:00 2001 From: Kim Kangmin Date: Mon, 23 Jun 2025 10:19:10 +0900 Subject: [PATCH 5/6] =?UTF-8?q?feat:=20=EB=B9=84=EB=B0=80=EB=B2=88?= =?UTF-8?q?=ED=98=B8=20=EB=B3=80=EA=B2=BD=20=EB=A1=9C=EC=A7=81=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - mutationFn 메소드의 객체 매개변수 프로퍼티 수정 - 비밀번호 변경 API URL, 요청 헤더, 바디 수정 --- src/features/user/hooks/useChangePassword.ts | 24 ++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/features/user/hooks/useChangePassword.ts b/src/features/user/hooks/useChangePassword.ts index c60cf81f..56f9a2be 100644 --- a/src/features/user/hooks/useChangePassword.ts +++ b/src/features/user/hooks/useChangePassword.ts @@ -9,18 +9,24 @@ export const useChangePassword = () => { return useMutation({ mutationFn: ({ newPassword, - confirmPassword, + currentPassword, }: { newPassword: string; - confirmPassword: string; + currentPassword: string; }) => { - const formData = new FormData(); - formData.append('newPassword', newPassword); - formData.append('confirmPassword', confirmPassword); - - return request.patch('/v1/user/edit', {}, formData, { - credentials: 'include', - }); + return request.patch( + '/v1/user/password-change', + { + 'Content-Type': 'application/json', + }, + { + newPassword, + confirmPassword: currentPassword, + }, + { + credentials: 'include', + }, + ); }, onSuccess() { toast.success('비밀번호 변경 성공', { From d32058fc402059cbf07c62c7496141e1a090b110 Mon Sep 17 00:00:00 2001 From: Kim Kangmin Date: Mon, 23 Jun 2025 10:21:48 +0900 Subject: [PATCH 6/6] =?UTF-8?q?fix:=20=EB=B6=88=ED=95=84=EC=9A=94=ED=95=9C?= =?UTF-8?q?=20import=EB=AC=B8=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/features/user/components/withdraw-dialog.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/features/user/components/withdraw-dialog.tsx b/src/features/user/components/withdraw-dialog.tsx index 4509faba..eefb8b2d 100644 --- a/src/features/user/components/withdraw-dialog.tsx +++ b/src/features/user/components/withdraw-dialog.tsx @@ -3,7 +3,6 @@ import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { toast } from 'sonner'; -import { Button } from '@/components/ui/button'; import { AlertDialog, AlertDialogTrigger,