From 44b925878853ae11ac1f2e782ce96e10c3aeb887 Mon Sep 17 00:00:00 2001 From: JAEMOON Date: Wed, 6 Dec 2023 20:54:46 +0900 Subject: [PATCH] =?UTF-8?q?[feat]=20=ED=94=84=EB=A1=9C=ED=95=84=20?= =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EC=97=85=EB=A1=9C=EB=93=9C=20?= =?UTF-8?q?=EC=B5=9C=EC=A2=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/userInfo/editProfile.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pages/userInfo/editProfile.tsx b/pages/userInfo/editProfile.tsx index 20644b5..134f5b2 100644 --- a/pages/userInfo/editProfile.tsx +++ b/pages/userInfo/editProfile.tsx @@ -15,6 +15,7 @@ import { UserInfoProps } from '@/context/UserInfoProvider.tsx'; import useModal from '@/hooks/useModal.ts'; import { uploadFile } from '@/api/room'; import { ImageListType } from 'react-images-uploading'; +import { RoomFile } from '@/public/types/room'; interface ProfileProps { _imageSrc: string; @@ -70,11 +71,12 @@ export default function EditProfile({ _imageSrc, userInfo }: ProfileProps) { try { // gender, const profileData = data as Profile; - profileData.profileId = userInfo.id || 0; + const imgResult = await uploadPhoto(imgFile as File); + profileData.profileId = imgResult?.id || userInfo?.id || 0; profileData.description = data?.describe || ''; profileData.gender = buttonState.toUpperCase(); profileData.birthDate = formatDate(data.dateOfBirth, 'yyyymmdd') || profileData.birthDate; - if (imgFile) await uploadPhoto(imgFile as File); + await modifyProfile(profileData); toast.error('Successfully saved'); closeModal();