From 3c77b4fe7f1aefeb72cc7d718e8204015fa8701e Mon Sep 17 00:00:00 2001 From: MinboyKim Date: Mon, 4 Dec 2023 18:50:39 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20Like=20bug=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 좋아요 버그 수정 --- packages/client/src/entities/like/Like.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/client/src/entities/like/Like.tsx b/packages/client/src/entities/like/Like.tsx index 226ef59..c4837c2 100644 --- a/packages/client/src/entities/like/Like.tsx +++ b/packages/client/src/entities/like/Like.tsx @@ -51,10 +51,10 @@ export default function Like({ postId, count }: PropsType) { useEffect(() => { const fetchLike = async () => { - const { data, error } = useFetch( - `${BASE_URL}post/${postId}/is-liked`, - ); - if (error) return; + const { data } = await instance({ + method: 'GET', + url: `/post/${postId}/is-liked`, + }); dispatch({ type: SET_LIKE, bool: data }); }; fetchLike(); @@ -67,7 +67,7 @@ export default function Like({ postId, count }: PropsType) { setButtonDisabled(true); const res = await instance({ method: 'patch', - url: `/post/${postId}/is-liked`, + url: `/post/${postId}/like`, }); if (res.status === 200) dispatch({ type: LIKE }); } finally { From 4f061a95ee575caeb69a68e0c784e1d947c5b1d6 Mon Sep 17 00:00:00 2001 From: MinboyKim Date: Mon, 4 Dec 2023 18:56:17 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9B=20Nickname=20bug=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 닉네임 모달 버그 수정 --- packages/client/src/shared/ui/inputBar/InputBar.tsx | 2 +- .../client/src/widgets/nickNameSetModal/NickNameSetModal.tsx | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/client/src/shared/ui/inputBar/InputBar.tsx b/packages/client/src/shared/ui/inputBar/InputBar.tsx index 842795c..86f9d1e 100644 --- a/packages/client/src/shared/ui/inputBar/InputBar.tsx +++ b/packages/client/src/shared/ui/inputBar/InputBar.tsx @@ -33,7 +33,7 @@ export default function InputBar({ const Container = styled.div` display: flex; flex-direction: column; - /* width: 100%; */ + width: 100%; `; const Input = styled.input` diff --git a/packages/client/src/widgets/nickNameSetModal/NickNameSetModal.tsx b/packages/client/src/widgets/nickNameSetModal/NickNameSetModal.tsx index f16a01a..1f3a604 100644 --- a/packages/client/src/widgets/nickNameSetModal/NickNameSetModal.tsx +++ b/packages/client/src/widgets/nickNameSetModal/NickNameSetModal.tsx @@ -11,18 +11,17 @@ export default function NickNameSetModal() { const [validNickName, setValidNickName] = useState(''); const navigate = useNavigate(); const { platform } = useParams(); + const { setText } = useToastStore(); + const { id, pw } = useSignUpStore(); useCheckLogin(); const handleSaveButton = async () => { // TODO: 소셜로그인 시 로직 따로 추가해야 함 - const { setText } = useToastStore(); - try { let response; if (!platform) { - const { id, pw } = useSignUpStore(); response = await postSignUp({ username: id, password: pw,