feat: add route error handling for invalid URL access in DetailForm component
This commit is contained in:
parent
19a11783d6
commit
cd28667f3c
@ -94,6 +94,14 @@ export default function DetailForm() {
|
|||||||
}))
|
}))
|
||||||
const [roofInfoData, setRoofInfoData] = useState<SurveyDetailRequest>(roofInfoForm)
|
const [roofInfoData, setRoofInfoData] = useState<SurveyDetailRequest>(roofInfoForm)
|
||||||
|
|
||||||
|
/** route 에러 처리 - 잘못된 URL 접근 시 생성 페이지로 리다이렉트 */
|
||||||
|
useEffect(() => {
|
||||||
|
if (modeset === 'CREATE' && pathname !== '/survey-sale/regist') {
|
||||||
|
router.replace('/survey-sale/regist')
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}, [modeset, id, pathname])
|
||||||
|
|
||||||
/** 제출 팝업 처리 - createSurvey 이후 popup 처리 시 노드 삽입 오류로 인해 별도 처리 */
|
/** 제출 팝업 처리 - createSurvey 이후 popup 처리 시 노드 삽입 오류로 인해 별도 처리 */
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const show = searchParams.get('show')
|
const show = searchParams.get('show')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user