@@ -17,18 +17,16 @@ interface UpdateLinkBody {
1717
1818interface 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
2625export 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