Skip to content

Commit 0d1fa32

Browse files
committed
Fix: linkstore totalCount 삭제
1 parent c8ed658 commit 0d1fa32

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

store/useLinkCardStore.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,16 @@ interface UpdateLinkBody {
1717

1818
interface LinkCardStore {
1919
linkCardList: LinkCardDataType[];
20-
totalCount: number;
2120
setLinkCardList: (list: LinkCardDataType[]) => void;
2221
updateLink: (linkId: number, body: UpdateLinkBody) => Promise<void>;
2322
deleteLink: (linkId: number) => Promise<void>;
2423
}
2524

2625
export const useLinkCardStore = create<LinkCardStore>((set) => ({
2726
linkCardList: [],
28-
totalCount: 0,
2927

3028
setLinkCardList: (list: LinkCardDataType[]) => {
31-
set({ linkCardList: list, totalCount: list.length });
29+
set({ linkCardList: list });
3230
},
3331

3432
// 수정 요청 보낸 후 목록 가져오기
@@ -40,7 +38,7 @@ export const useLinkCardStore = create<LinkCardStore>((set) => ({
4038
const updatedList = res.list;
4139

4240
// 상태 업데이트
43-
set({ linkCardList: updatedList, totalCount: updatedList.length });
41+
set({ linkCardList: updatedList });
4442
} catch (error) {
4543
console.error("삭제 중 오류 발생:", error);
4644
}
@@ -54,7 +52,7 @@ export const useLinkCardStore = create<LinkCardStore>((set) => ({
5452
const updatedList = res.list;
5553

5654
// 상태 업데이트
57-
set({ linkCardList: updatedList, totalCount: updatedList.length });
55+
set({ linkCardList: updatedList });
5856
} catch (error) {
5957
console.error("삭제 중 오류 발생:", error);
6058
}

0 commit comments

Comments
 (0)