Canvas 상태 조회 조건 userId 추가
This commit is contained in:
parent
8bd0166d08
commit
3190a4420a
@ -143,7 +143,7 @@ export default function Roof2(props) {
|
|||||||
// const [canvasState, setCanvasState] = useRecoilState(canvasAtom)
|
// const [canvasState, setCanvasState] = useRecoilState(canvasAtom)
|
||||||
|
|
||||||
useEffect(() => {
|
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)
|
console.log(res)
|
||||||
|
|
||||||
const arrangeData = res.map((item) => {
|
const arrangeData = res.map((item) => {
|
||||||
|
|||||||
@ -28,11 +28,7 @@ export default function DotLineGrid(props) {
|
|||||||
const SelectOption = [
|
const SelectOption = [
|
||||||
{ id: 1, name: getMessage('modal.canvas.setting.grid.dot.line.setting.line.origin'), value: 1 },
|
{ id: 1, name: getMessage('modal.canvas.setting.grid.dot.line.setting.line.origin'), value: 1 },
|
||||||
{ id: 2, name: '1/2', value: 1 / 2 },
|
{ 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 },
|
{ id: 4, name: '1/10', value: 1 / 10 },
|
||||||
]
|
]
|
||||||
const [selectOption, setSelectOption] = useState(SelectOption[0])
|
const [selectOption, setSelectOption] = useState(SelectOption[0])
|
||||||
|
|||||||
@ -3,6 +3,8 @@ import { canvasState, currentCanvasPlanState, initCanvasPlansState } from '@/sto
|
|||||||
import { useAxios } from '@/hooks/useAxios'
|
import { useAxios } from '@/hooks/useAxios'
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { toastUp } from '@/hooks/useToast'
|
import { toastUp } from '@/hooks/useToast'
|
||||||
|
import { sessionStore } from '@/store/commonAtom'
|
||||||
|
import { useState } from 'react'
|
||||||
|
|
||||||
export function usePlan() {
|
export function usePlan() {
|
||||||
const [canvas, setCanvas] = useRecoilState(canvasState)
|
const [canvas, setCanvas] = useRecoilState(canvasState)
|
||||||
@ -10,6 +12,8 @@ export function usePlan() {
|
|||||||
const [initCanvasPlans, setInitCanvasPlans] = useRecoilState(initCanvasPlansState)
|
const [initCanvasPlans, setInitCanvasPlans] = useRecoilState(initCanvasPlansState)
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { get, promisePost, promisePut } = useAxios()
|
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 목록을 조회하는 함수
|
* objectNo에 해당하는 canvas 목록을 조회하는 함수
|
||||||
*/
|
*/
|
||||||
const getCanvasByObjectNo = async (objectNo) => {
|
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) => ({
|
res.map((item) => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
name: item.objectNo + '-' + item.id, // tab button에 표출될 이름 (임시)
|
name: item.objectNo + '-' + item.id, // tab button에 표출될 이름 (임시)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user