File tree Expand file tree Collapse file tree 1 file changed +25
-4
lines changed
Expand file tree Collapse file tree 1 file changed +25
-4
lines changed Original file line number Diff line number Diff line change 11import axiosInstance from "./axiosInstance" ;
2- import type { CardDetailType } from "@/types/cards" ; // Dashboard 타입 import
2+ import type { CardType } from "@/types/cards" ; // Dashboard 타입 import
33import { apiRoutes } from "@/api/apiRoutes" ;
44
55/** 1. 카드 이미지 업로드 */
@@ -114,13 +114,34 @@ export const updateCard = async ({
114114 return response . data ;
115115} ;
116116
117- //카드조회
118- export async function getCardDetail ( cardId : number ) : Promise < CardDetailType > {
117+ // 카드 목록 조회
118+ export const getCardsByColumn = async ( {
119+ columnId,
120+ cursorId,
121+ size = 10 ,
122+ } : {
123+ columnId : number ;
124+ cursorId ?: number ;
125+ size ?: number ;
126+ } ) => {
127+ const res = await axiosInstance . get ( apiRoutes . cards ( ) , {
128+ params : {
129+ columnId,
130+ cursorId,
131+ size,
132+ } ,
133+ } ) ;
134+
135+ return res . data ;
136+ } ;
137+
138+ // 카드 상세 조회
139+ export async function getCardDetail ( cardId : number ) : Promise < CardType > {
119140 try {
120141 // apiRoutes를 사용하여 URL 동적 생성
121142 const url = apiRoutes . cardDetail ( cardId ) ;
122143 const response = await axiosInstance . get ( url ) ;
123- return response . data as CardDetailType ;
144+ return response . data as CardType ;
124145 } catch ( error ) {
125146 console . error ( "대시보드 데이터를 불러오는 데 실패했습니다." , error ) ;
126147 throw error ;
You can’t perform that action at this time.
0 commit comments