diff --git a/apps/dm/app/store/sdmMng/index.tsx b/apps/dm/app/store/sdmMng/index.tsx index b5b258839..ef7fb4cea 100644 --- a/apps/dm/app/store/sdmMng/index.tsx +++ b/apps/dm/app/store/sdmMng/index.tsx @@ -167,7 +167,7 @@ export type DemandMatchings = { // 유사사례 export type SimilarCaseType = { - ruseBizNm : string | ''; + ruseBizNm : string | ''; // 사업명 bizBgngDate : string | ''; bizEndDate : string | ''; splyFcltKnd : string | ''; @@ -751,11 +751,23 @@ export const SdmReducer = (set: any): SdmActions => { // 유사사례 조회 getSimilarCaseList: async (part: string, value: number|string) => { const res = await fetchGetSimilarCaseList(part, value); - if(res && res.length !== 0) { + const similarCaseList = res.map((el: SimilarCaseType) => { + const maskedBizNm = el.ruseBizNm + ? el.ruseBizNm.replace(/^(\s*)^\S+/, "***") // 첫 단어(공백 전까지) 치환 + : el.ruseBizNm; + + return { + ...el, + ruseBizNm: maskedBizNm, + }; + }); + console.log(similarCaseList); + + if(similarCaseList && similarCaseList.length !== 0) { set((state: SdmType) => ({ Sdm: { ...state.Sdm, - similarCaseList: res, + similarCaseList: similarCaseList, } })) return;