Files
frontend/packages/common/components/src/api/attachment.ts
T
2025-12-24 20:29:43 +09:00

15 lines
450 B
TypeScript

import { getConfig } from "@common/config";
import { ENDPOINT } from "../config";
const { PROXY_HOST } = getConfig();
const BASE_URL = `${PROXY_HOST}/server`;
export const getImageUrlByAtflCd = async (atflCd: string): Promise<string> => {
if (!atflCd) return "";
const response = await fetch(
`${BASE_URL}${ENDPOINT.ATTACH_SERVICE.IMAGES}/atflCd/${atflCd}`,
);
const blob = await response.blob();
return URL.createObjectURL(blob);
};