diff --git a/src/components/Roof2.jsx b/src/components/Roof2.jsx index d8b4c25e..fe79d2b5 100644 --- a/src/components/Roof2.jsx +++ b/src/components/Roof2.jsx @@ -42,6 +42,7 @@ import { SurfaceShapeModal } from '@/components/ui/SurfaceShape' import { changeAllGableRoof, drawDirectionStringToArrow } from '@/util/qpolygon-utils' import ThumbnailList from '@/components/ui/ThumbnailLIst' import ObjectPlacement from '@/components/ui/ObjectPlacement' +import { globalLocaleStore } from '@/store/localeAtom' export default function Roof2(props) { const { name, userId, email, isLoggedIn } = props @@ -58,7 +59,9 @@ export default function Roof2(props) { setBackImg, } = useCanvas('canvas') - const { get } = useAxios() + const globalLocaleState = useRecoilValue(globalLocaleStore) + + const { get } = useAxios(globalLocaleState) const canvasRef = useRef(null) diff --git a/src/components/floor-plan/FloorPlan.jsx b/src/components/floor-plan/FloorPlan.jsx index 206c41c4..33e522ee 100644 --- a/src/components/floor-plan/FloorPlan.jsx +++ b/src/components/floor-plan/FloorPlan.jsx @@ -6,10 +6,15 @@ import CanvasLayout from '@/components/floor-plan/CanvasLayout' import '@/styles/contents.scss' import OuterLineWall from '@/components/floor-plan/modal/outerlinesetting/OuterLineWall' import { useEffect, useState } from 'react' +import { globalLocaleStore } from '@/store/localeAtom' +import { useRecoilValue } from 'recoil' +import { useAxios } from '@/hooks/useAxios' export default function FloorPlan() { const [showCanvasSettingModal, setShowCanvasSettingModal] = useState(false) const [showOutlineModal, setShowOutlineModal] = useState(false) + const globalLocaleState = useRecoilValue(globalLocaleStore) + const { get } = useAxios(globalLocaleState) const canvasSettingProps = { setShowCanvasSettingModal, diff --git a/src/hooks/useAxios.js b/src/hooks/useAxios.js index d06d3a2e..852a1798 100644 --- a/src/hooks/useAxios.js +++ b/src/hooks/useAxios.js @@ -5,7 +5,7 @@ const AxiosType = { EXTERNAL: 'External', } -export function useAxios() { +export function useAxios(lang = '') { const getInstances = (url) => { let type = AxiosType.INTERNAL url.startsWith('http') ? (type = AxiosType.EXTERNAL) : '' @@ -14,6 +14,7 @@ export function useAxios() { baseURL: type === AxiosType.INTERNAL ? process.env.NEXT_PUBLIC_API_SERVER_PATH : '', headers: { Accept: 'application/json', + lang, }, }) }