대표 이미지 저장 기능 구현
This commit is contained in:
@@ -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("대표 파일 설정에 실패했습니다.");
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user