데이터 테이블 첨부파일 연계

This commit is contained in:
kjs
2025-09-06 00:16:27 +09:00
parent d73be8a4d3
commit 0b38f349aa
10 changed files with 1015 additions and 166 deletions

View File

@@ -144,3 +144,29 @@ export const uploadFilesAndCreateData = async (files: FileList) => {
throw error;
}
};
/**
* 테이블 연결된 파일 조회
*/
export const getLinkedFiles = async (
tableName: string,
recordId: string,
): Promise<{
success: boolean;
files: any[];
totalCount: number;
targetObjid: string;
}> => {
try {
console.log("📎 연결된 파일 조회:", { tableName, recordId });
const response = await apiClient.get(`/files/linked/${tableName}/${recordId}`);
console.log("✅ 연결된 파일 조회 성공:", response.data);
return response.data;
} catch (error) {
console.error("연결된 파일 조회 오류:", error);
throw new Error("연결된 파일 조회에 실패했습니다.");
}
};