dm: 유사사례 사업명 ***처리
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user