1018 - 캔버스팝업상태 복사저장, 조회 : unescapeString() if => while 변경

This commit is contained in:
ysCha 2025-04-25 14:02:35 +09:00
parent 3b96344943
commit 9bf961441b
2 changed files with 12 additions and 1 deletions

View File

@ -21,6 +21,7 @@ import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedM
import { useCanvasPopupStatusController } from './common/useCanvasPopupStatusController'
import { useCanvasMenu } from './common/useCanvasMenu'
import { QcastContext } from '@/app/QcastProvider'
import { unescapeString } from '@/util/common-utils'
/**
* 플랜 처리
@ -264,7 +265,7 @@ export function usePlan(params = {}) {
objectNo,
planNo: parseInt(newPlan.planNo),
popupType: 1,
popupStatus: sourceDegree.popupStatus,
popupStatus: unescapeString(sourceDegree.popupStatus),
}
console.log('🚀 ~ postObjectPlan ~ degreeData:', degreeData)
await post({ url: `/api/v1/canvas-popup-status`, data: degreeData })

View File

@ -145,9 +145,19 @@ export const unescapeString = (str) => {
''': "'",
}
/*
1. 한번 변환은 {" 변환됨 : 에러 발생 => while 변경
2. 변환할 내용이 없으면 리턴값이 undefined
if (regex.test(str)) {
return str.replace(regex, (matched) => chars[matched] || matched)
}
*/
while (regex.test(str)) {
str = str.replace(regex, (matched) => chars[matched] || matched);
}
return str
}
export const isNullOrUndefined = (value) => {