refactor: blob 이미지 가져오는 방식 수정

This commit is contained in:
2025-04-08 10:39:04 +09:00
parent 2797ec210e
commit d6b48ea554
5 changed files with 28 additions and 11 deletions
@@ -12,6 +12,13 @@ export class AttachmentApiService implements AttachmentService {
);
return response.data;
}
public async getImageUrl(atflId: string): Promise<string> {
if (!atflId) return "";
const response = await fetch(`${ENDPOINT.ATTACH_SERVICE.IMAGES}/${atflId}`);
const blob = await response.blob();
return URL.createObjectURL(blob);
}
}
export const AttachmentApi = new AttachmentApiService();
@@ -15,4 +15,5 @@ export interface Attachment {
export interface AttachmentService {
getAttachments: (atflCd: string) => Promise<Attachment[]>;
getImageUrl: (atflId: string) => Promise<string>;
}