Skip to content

Commit 339f5b0

Browse files
authored
Merge pull request #137 from part3-4team-Taskify/MINJI121-patch-1
[Fix] Update card.ts
2 parents ed55bd3 + ae324da commit 339f5b0

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

src/api/card.ts

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import axiosInstance from "./axiosInstance";
2-
import type { CardDetailType } from "@/types/cards"; // Dashboard 타입 import
2+
import type { CardType } from "@/types/cards"; // Dashboard 타입 import
33
import { 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;

0 commit comments

Comments
 (0)