15 lines
450 B
TypeScript
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);
|
|
};
|