📌fix: objectNo 세팅 위치 수정
This commit is contained in:
parent
f290491caa
commit
fecfa67305
@ -1,9 +1,6 @@
|
||||
'ues client'
|
||||
|
||||
import { createContext, useEffect, useState } from 'react'
|
||||
import { useSearchParams } from 'next/navigation'
|
||||
import { useSetRecoilState } from 'recoil'
|
||||
import { correntObjectNoState } from '@/store/settingAtom'
|
||||
|
||||
export const ManagementContext = createContext({
|
||||
managementState: {},
|
||||
@ -13,11 +10,6 @@ export const ManagementContext = createContext({
|
||||
const ManagementProvider = ({ children }) => {
|
||||
const [managementState, setManagementState] = useState({})
|
||||
|
||||
const setCurrentObjectNo = useSetRecoilState(correntObjectNoState)
|
||||
const searchParams = useSearchParams()
|
||||
const objectNo = searchParams.get('objectNo')
|
||||
setCurrentObjectNo(objectNo)
|
||||
|
||||
useEffect(() => {
|
||||
console.log('🚀 ~ managementState:', managementState)
|
||||
}, [managementState])
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
'use client'
|
||||
|
||||
import { useEffect, useState, useContext } from 'react'
|
||||
import { useRecoilValue } from 'recoil'
|
||||
import { useRecoilValue, useSetRecoilState } from 'recoil'
|
||||
import { floorPlanObjectState } from '@/store/floorPlanObjectAtom'
|
||||
import { useMessage } from '@/hooks/useMessage'
|
||||
import { useCanvasMenu } from '@/hooks/common/useCanvasMenu'
|
||||
@ -18,6 +18,8 @@ import Select, { components } from 'react-select'
|
||||
import { convertNumberToPriceDecimal, convertNumberToPriceDecimalToFixed } from '@/util/common-utils'
|
||||
import ProductFeaturesPop from './popup/ProductFeaturesPop'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { correntObjectNoState } from '@/store/settingAtom'
|
||||
import { useSearchParams } from 'next/navigation'
|
||||
|
||||
export default function Estimate({ params }) {
|
||||
const [uniqueData, setUniqueData] = useState([])
|
||||
@ -74,6 +76,15 @@ export default function Estimate({ params }) {
|
||||
|
||||
const { setMenuNumber } = useCanvasMenu()
|
||||
|
||||
/**
|
||||
* objectNo 셋팅
|
||||
* url로 넘어온 objectNo을 리코일에 세팅
|
||||
*/
|
||||
const setCurrentObjectNo = useSetRecoilState(correntObjectNoState)
|
||||
const searchParams = useSearchParams()
|
||||
const currentObjectNo = searchParams.get('objectNo')
|
||||
setCurrentObjectNo(currentObjectNo)
|
||||
|
||||
//새로 추가한 첨부파일 props
|
||||
const fileUploadProps = {
|
||||
uploadFiles: files,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user