Skip to content

Commit

Permalink
Merge pull request #225 from boostcampwm2023/hotfix
Browse files Browse the repository at this point in the history
[FE] 닉네임 모달, 좋아요 버그 수정
  • Loading branch information
qkrwogk authored Dec 4, 2023
2 parents e7bf599 + 4f061a9 commit fbec0ae
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
10 changes: 5 additions & 5 deletions packages/client/src/entities/like/Like.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ export default function Like({ postId, count }: PropsType) {

useEffect(() => {
const fetchLike = async () => {
const { data, error } = useFetch<boolean>(
`${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();
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/shared/ui/inputBar/InputBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit fbec0ae

Please sign in to comment.