Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: qa 오류 수정 #262

Merged
merged 3 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions src/category/api/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import client from '@/common/service/client';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { useNavigate } from 'react-router-dom';
import { GET_CATEGORY_LIST } from './category';
import useBookmarkStore from '@/store/bookmark';
import { navigatePath } from '@/constants/navigatePath';
import { bookmarkAddPagePaths } from '@/pages/CategoryManagePage';

interface CategoryItem {
name: string;
Expand Down Expand Up @@ -36,30 +33,12 @@ export const usePOSTCategoryMutation = ({ memberId }: POSTCategoryMutation) => {
const queryClient = useQueryClient();

const router = useNavigate();
const { fromPath } = useBookmarkStore();

return useMutation(POSTCategory.API, {
onSuccess: async () => {
await queryClient.refetchQueries(GET_CATEGORY_LIST(memberId));
queryClient.refetchQueries(GET_BOOKMARK_CATEGORY_LIST(memberId));

if (fromPath === navigatePath.MAIN) {
router('/', {
preventScrollReset: true,
state: {
isCategoryAddPage: true,
},
});
return;
}
if (bookmarkAddPagePaths.some((path) => path.includes(fromPath))) {
router(fromPath, {
state: {
isCategoryAddPage: true,
},
});
return;
}
router(-1);
},
});
Expand Down
3 changes: 3 additions & 0 deletions src/common-ui/CheckBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ export const CheckBox: ForwardRefRenderFunction<
type={'checkbox'}
id={id}
onChange={_onChange}
onClick={() => {
onChange?.(true);
}}
checked={checked}
{...restProps}
ref={ref}
Expand Down
11 changes: 10 additions & 1 deletion src/common/ui/ListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,16 @@ interface ListItemProps {
}

const ListItem = ({ children, onClick }: ListItemProps) => {
return <ItemWrapper onClick={onClick}>{children}</ItemWrapper>;
return (
<ItemWrapper
onClick={(e) => {
e.preventDefault();
onClick && onClick();
}}
>
{children}
</ItemWrapper>
);
};

const ItemWrapper = styled.div`
Expand Down
4 changes: 2 additions & 2 deletions src/pages/IntroducePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const IntroducePage = () => {
bookmarkId={1}
commentCnt={3}
isUserLike
createdDate="20"
createdDate="2023-08-09"
previewImageUrl="/image/"
readByUser={false}
title="피클리는 이런 서비스에요"
Expand All @@ -47,7 +47,7 @@ const IntroducePage = () => {
<SubTitle level="h3" fontSize={1.5} weight="bold">
Pick 2.
</SubTitle>
<Description>북마크를 자유롭게 추가할 수 있어요!</Description>
<Description>읽지 않은 북마크는 저희가 알려드릴게요!</Description>
</BoxWrapper>
<PaddingWrapper>
<SettingsBox serverRemindInDays={3} disabled />
Expand Down
Loading