fix: 업로드 진행하면 강제로 설정 on
This commit is contained in:
parent
1e2926d075
commit
aead423eda
Binary file not shown.
@ -6,6 +6,7 @@ import { useAxios } from '../useAxios'
|
|||||||
import { currentCanvasPlanState } from '@/store/canvasAtom'
|
import { currentCanvasPlanState } from '@/store/canvasAtom'
|
||||||
import { useCanvas } from '@/hooks/useCanvas'
|
import { useCanvas } from '@/hooks/useCanvas'
|
||||||
import { deleteBackGroundImage, setBackGroundImage } from '@/lib/imageActions'
|
import { deleteBackGroundImage, setBackGroundImage } from '@/lib/imageActions'
|
||||||
|
import { settingModalFirstOptionsState } from '@/store/settingAtom'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 배경 이미지 관리
|
* 배경 이미지 관리
|
||||||
@ -20,6 +21,7 @@ export function useRefFiles() {
|
|||||||
const [currentBgImage, setCurrentBgImage] = useState(null)
|
const [currentBgImage, setCurrentBgImage] = useState(null)
|
||||||
const queryRef = useRef(null)
|
const queryRef = useRef(null)
|
||||||
const [currentCanvasPlan, setCurrentCanvasPlan] = useRecoilState(currentCanvasPlanState)
|
const [currentCanvasPlan, setCurrentCanvasPlan] = useRecoilState(currentCanvasPlanState)
|
||||||
|
const [settingModalFirstOptions, setSettingModalFirstOptions] = useRecoilState(settingModalFirstOptionsState)
|
||||||
const { handleBackImageLoadToCanvas } = useCanvas()
|
const { handleBackImageLoadToCanvas } = useCanvas()
|
||||||
const { swalFire } = useSwal()
|
const { swalFire } = useSwal()
|
||||||
const { get, post } = useAxios()
|
const { get, post } = useAxios()
|
||||||
@ -116,6 +118,16 @@ export function useRefFiles() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const newOption1 = settingModalFirstOptions.option1.map((option) => ({
|
||||||
|
...option,
|
||||||
|
selected: option.column === 'imageDisplay' ? true : option.selected,
|
||||||
|
}))
|
||||||
|
|
||||||
|
setSettingModalFirstOptions((prev) => ({
|
||||||
|
...prev,
|
||||||
|
option1: newOption1,
|
||||||
|
}))
|
||||||
|
|
||||||
const res = await get({
|
const res = await get({
|
||||||
url: `${process.env.NEXT_PUBLIC_HOST_URL}/map/convert?q=${queryRef.current.value}&fileNm=${currentCanvasPlan.id}&zoom=20`,
|
url: `${process.env.NEXT_PUBLIC_HOST_URL}/map/convert?q=${queryRef.current.value}&fileNm=${currentCanvasPlan.id}&zoom=20`,
|
||||||
})
|
})
|
||||||
@ -150,6 +162,16 @@ export function useRefFiles() {
|
|||||||
* @param {*} file
|
* @param {*} file
|
||||||
*/
|
*/
|
||||||
const handleUploadImageRefFile = async (file) => {
|
const handleUploadImageRefFile = async (file) => {
|
||||||
|
const newOption1 = settingModalFirstOptions.option1.map((option) => ({
|
||||||
|
...option,
|
||||||
|
selected: option.column === 'imageDisplay' ? true : option.selected,
|
||||||
|
}))
|
||||||
|
|
||||||
|
setSettingModalFirstOptions((prev) => ({
|
||||||
|
...prev,
|
||||||
|
option1: newOption1,
|
||||||
|
}))
|
||||||
|
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
formData.append('file', file)
|
formData.append('file', file)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user