지붕재 데이터 hook 사용
This commit is contained in:
parent
b5aeed7874
commit
7e2180cd76
@ -14,6 +14,7 @@ export function useMasterController() {
|
||||
const getRoofMaterialList = async () => {
|
||||
return await get({ url: '/api/v1/master/getRoofMaterialList' }).then((res) => {
|
||||
console.log('🚀🚀 ~ getRoofMaterialList ~ res:', res)
|
||||
return res
|
||||
})
|
||||
}
|
||||
|
||||
@ -25,6 +26,7 @@ export function useMasterController() {
|
||||
const getModuleTypeItemList = async (roofMaterialCd) => {
|
||||
return await get({ url: `/api/v1/master/getModuleTypeItemList/${roofMaterialCd}` }).then((res) => {
|
||||
console.log('🚀🚀 ~ getModuleTypeItemList ~ res:', res)
|
||||
return res
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -27,6 +27,7 @@ import { globalFontAtom } from '@/store/fontAtom'
|
||||
import { dimensionLineSettingsState } from '@/store/commonUtilsAtom'
|
||||
import { gridColorState } from '@/store/gridAtom'
|
||||
import { useColor } from 'react-color-palette'
|
||||
import { useMasterController } from '@/hooks/common/useMasterController'
|
||||
|
||||
const defaultDotLineGridSetting = {
|
||||
INTERVAL: {
|
||||
@ -91,7 +92,7 @@ export function useCanvasSetting() {
|
||||
|
||||
const [canvasSetting, setCanvasSetting] = useRecoilState(canvasSettingState)
|
||||
const [basicSetting, setBasicSettings] = useRecoilState(basicSettingState)
|
||||
|
||||
const { getRoofMaterialList } = useMasterController()
|
||||
const [roofMaterials, setRoofMaterials] = useRecoilState(roofMaterialsAtom)
|
||||
|
||||
const SelectOptions = [
|
||||
@ -101,10 +102,9 @@ export function useCanvasSetting() {
|
||||
{ id: 4, name: '1/10', value: 1 / 10 },
|
||||
]
|
||||
|
||||
useEffect(() => {
|
||||
get({ url: `/api/v1/master/getRoofMaterialList` }).then((res) => {
|
||||
setRoofMaterials(res.data)
|
||||
})
|
||||
useEffect(async () => {
|
||||
const { data } = await getRoofMaterialList()
|
||||
setRoofMaterials(data)
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user