refactor: blob 이미지 가져오는 방식 수정
This commit is contained in:
@@ -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>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user