Skip to content

Commit

Permalink
Merge pull request #50 from Read-bird/feature/yj
Browse files Browse the repository at this point in the history
버그 수정
  • Loading branch information
hyu-dev authored Dec 30, 2023
2 parents 1b343bf + 29398d0 commit 71fd734
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/components/templates/HomeTemplate/Week/WeekTemplate.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { setPlan } from '@/store/reducers';
import { TRootState } from '@/store/state';
import { axiosFetch } from '@api/axios';
import { TRegisterFormValue } from '@api/types';
import { ERecordStatus, TRegisterFormValue } from '@api/types';
import { IconPlus } from '@assets/icons';
import { WeekCalendar } from '@components/common/Calendar';
import { Spacing } from '@components/common/Spacing';
Expand Down Expand Up @@ -64,6 +64,8 @@ export const WeekTemplate = () => {
const date = useMemo(() => new Date(currentDate), [currentDate]);
const [isModalOpen, setIsModalOpen] = useState(false);

const iconSize = planData.filter((plan) => plan.planStatus === ERecordStatus.inProgress).length;

// 등록하기 모달 띄우기
const handleClickAdd = async () => {
const result = await planValidation();
Expand Down Expand Up @@ -112,7 +114,7 @@ export const WeekTemplate = () => {
1: <IconEggOnePlan />,
2: <IconEggTwoPlan />,
3: <IconEggThreePlan />
}[planData?.length ?? 0]
}[iconSize]
}
</PlanVisualBox>
<Spacing height={20} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const MyLibraryTemplate = () => {

const getNextPage = useCallback(() => {
getPlanList(page.current + 1);
page.current += 1;
}, []);

const itemData = useMemo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@ export const SearchResult = memo(() => {
setValue('searchType', CheckBoxType[checkbox as keyof typeof CheckBoxType]);
setValue('page', 1);

await searchList({
const result = await searchList({
...props,
searchType: CheckBoxType[checkbox as keyof typeof CheckBoxType],
page: 1
});

if (result) {
setValue('page', 2);
}
},
[setValue, searchList, getValues]
);
Expand Down

0 comments on commit 71fd734

Please sign in to comment.