1018 - 캔버스팝업상태 복사저장, 조회 : unescapeString() if => while 변경 #31
@ -21,6 +21,7 @@ import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedM
|
|||||||
import { useCanvasPopupStatusController } from './common/useCanvasPopupStatusController'
|
import { useCanvasPopupStatusController } from './common/useCanvasPopupStatusController'
|
||||||
import { useCanvasMenu } from './common/useCanvasMenu'
|
import { useCanvasMenu } from './common/useCanvasMenu'
|
||||||
import { QcastContext } from '@/app/QcastProvider'
|
import { QcastContext } from '@/app/QcastProvider'
|
||||||
|
import { unescapeString } from '@/util/common-utils'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 플랜 처리 훅
|
* 플랜 처리 훅
|
||||||
@ -264,7 +265,7 @@ export function usePlan(params = {}) {
|
|||||||
objectNo,
|
objectNo,
|
||||||
planNo: parseInt(newPlan.planNo),
|
planNo: parseInt(newPlan.planNo),
|
||||||
popupType: 1,
|
popupType: 1,
|
||||||
popupStatus: sourceDegree.popupStatus,
|
popupStatus: unescapeString(sourceDegree.popupStatus),
|
||||||
}
|
}
|
||||||
console.log('🚀 ~ postObjectPlan ~ degreeData:', degreeData)
|
console.log('🚀 ~ postObjectPlan ~ degreeData:', degreeData)
|
||||||
await post({ url: `/api/v1/canvas-popup-status`, data: degreeData })
|
await post({ url: `/api/v1/canvas-popup-status`, data: degreeData })
|
||||||
|
|||||||
@ -145,9 +145,19 @@ export const unescapeString = (str) => {
|
|||||||
''': "'",
|
''': "'",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
1. 한번 변환은 {" 로 변환됨 : 에러 발생 => while 변경
|
||||||
|
2. 변환할 내용이 없으면 리턴값이 undefined
|
||||||
|
|
||||||
if (regex.test(str)) {
|
if (regex.test(str)) {
|
||||||
return str.replace(regex, (matched) => chars[matched] || matched)
|
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) => {
|
export const isNullOrUndefined = (value) => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user