대표 이미지 저장 기능 구현

This commit is contained in:
dohyeons
2025-11-05 15:50:29 +09:00
parent 9429033e2c
commit df779ac04c
4 changed files with 108 additions and 37 deletions

View File

@@ -249,3 +249,19 @@ export const getDirectFileUrl = (filePath: string): string => {
const baseUrl = process.env.NEXT_PUBLIC_API_URL?.replace("/api", "") || "";
return `${baseUrl}${filePath}`;
};
/**
* 대표 파일 설정
*/
export const setRepresentativeFile = async (objid: string): Promise<{
success: boolean;
message: string;
}> => {
try {
const response = await apiClient.put(`/files/representative/${objid}`);
return response.data;
} catch (error) {
console.error("대표 파일 설정 오류:", error);
throw new Error("대표 파일 설정에 실패했습니다.");
}
};