Canvas 상태 조회 조건 userId 추가

This commit is contained in:
changkyu choi 2024-09-27 18:16:09 +09:00
parent 8bd0166d08
commit 3190a4420a
3 changed files with 7 additions and 7 deletions

View File

@ -143,7 +143,7 @@ export default function Roof2(props) {
// const [canvasState, setCanvasState] = useRecoilState(canvasAtom)
useEffect(() => {
get({ url: `/api/canvas-management/canvas-statuses/by-object/test123240822001` }).then((res) => {
get({ url: `/api/canvas-management/canvas-statuses/by-object/test123240822001/${userId}` }).then((res) => {
console.log(res)
const arrangeData = res.map((item) => {

View File

@ -28,11 +28,7 @@ export default function DotLineGrid(props) {
const SelectOption = [
{ id: 1, name: getMessage('modal.canvas.setting.grid.dot.line.setting.line.origin'), value: 1 },
{ id: 2, name: '1/2', value: 1 / 2 },
{
id: 3,
name: '1/4',
value: 1 / 4,
},
{ id: 3, name: '1/4', value: 1 / 4 },
{ id: 4, name: '1/10', value: 1 / 10 },
]
const [selectOption, setSelectOption] = useState(SelectOption[0])

View File

@ -3,6 +3,8 @@ import { canvasState, currentCanvasPlanState, initCanvasPlansState } from '@/sto
import { useAxios } from '@/hooks/useAxios'
import { useMessage } from '@/hooks/useMessage'
import { toastUp } from '@/hooks/useToast'
import { sessionStore } from '@/store/commonAtom'
import { useState } from 'react'
export function usePlan() {
const [canvas, setCanvas] = useRecoilState(canvasState)
@ -10,6 +12,8 @@ export function usePlan() {
const [initCanvasPlans, setInitCanvasPlans] = useRecoilState(initCanvasPlansState)
const { getMessage } = useMessage()
const { get, promisePost, promisePut } = useAxios()
const [sessionState, setSessionState] = useRecoilState(sessionStore)
const [userId, setUserId] = useState(sessionState.userId)
/**
* 마우스 포인터의 가이드라인을 제거합니다.
@ -134,7 +138,7 @@ export function usePlan() {
* objectNo에 해당하는 canvas 목록을 조회하는 함수
*/
const getCanvasByObjectNo = async (objectNo) => {
return get({ url: `/api/canvas-management/canvas-statuses/by-object/${objectNo}` }).then((res) =>
return get({ url: `/api/canvas-management/canvas-statuses/by-object/${objectNo}/${userId}` }).then((res) =>
res.map((item) => ({
id: item.id,
name: item.objectNo + '-' + item.id, // tab button에 표출될 이름 (임시)