plan 추가 로직 삼항연산자 -> if 로 변경
This commit is contained in:
parent
a08c609caa
commit
51a2782d3c
@ -449,26 +449,26 @@ export function usePlan(params = {}) {
|
|||||||
if (currentCanvasPlan?.id) {
|
if (currentCanvasPlan?.id) {
|
||||||
await saveCanvas(false)
|
await saveCanvas(false)
|
||||||
}
|
}
|
||||||
JSON.parse(currentCanvasData()).objects.length > 0
|
if (JSON.parse(currentCanvasData()).objects.length > 0) {
|
||||||
? swalFire({
|
swalFire({
|
||||||
text: `Plan ${currentCanvasPlan.planNo} ` + getMessage('plan.message.confirm.copy'),
|
text: `Plan ${currentCanvasPlan.planNo} ` + getMessage('plan.message.confirm.copy'),
|
||||||
type: 'confirm',
|
type: 'confirm',
|
||||||
confirmFn: async () => {
|
confirmFn: async () => {
|
||||||
setIsGlobalLoading(true)
|
setIsGlobalLoading(true)
|
||||||
await postObjectPlan(userId, objectNo, true, false)
|
await postObjectPlan(userId, objectNo, true, false)
|
||||||
setIsGlobalLoading(false)
|
setIsGlobalLoading(false)
|
||||||
},
|
},
|
||||||
denyFn: async () => {
|
denyFn: async () => {
|
||||||
setIsGlobalLoading(true)
|
|
||||||
await postObjectPlan(userId, objectNo, false, false)
|
|
||||||
setIsGlobalLoading(false)
|
|
||||||
},
|
|
||||||
})
|
|
||||||
: async () => {
|
|
||||||
setIsGlobalLoading(true)
|
setIsGlobalLoading(true)
|
||||||
await postObjectPlan(userId, objectNo, false, false)
|
await postObjectPlan(userId, objectNo, false, false)
|
||||||
setIsGlobalLoading(false)
|
setIsGlobalLoading(false)
|
||||||
}
|
},
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
setIsGlobalLoading(true)
|
||||||
|
await postObjectPlan(userId, objectNo, false, false)
|
||||||
|
setIsGlobalLoading(false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user