물건 상세 api 에러 메세지 띄우도록
This commit is contained in:
parent
96b163f1ac
commit
9042731ff8
@ -917,7 +917,11 @@ export default function StuffDetail() {
|
||||
})
|
||||
|
||||
//설계의뢰 팝업에선 WL_안붙어서 옴
|
||||
form.setValue('standardWindSpeedId', `WL_${info.windSpeed}`)
|
||||
if (info.windSpeed !== '') {
|
||||
form.setValue('standardWindSpeedId', `WL_${info.windSpeed}`)
|
||||
} else {
|
||||
form.setValue('standardWindSpeedId', `WL_${info.windSpeed}`)
|
||||
}
|
||||
form.setValue('verticalSnowCover', info.verticalSnowCover)
|
||||
form.setValue('surfaceType', info.surfaceType)
|
||||
|
||||
@ -1046,7 +1050,7 @@ export default function StuffDetail() {
|
||||
errors.prefId = true
|
||||
}
|
||||
|
||||
if (!formData.areaId) {
|
||||
if (!formData.areaId || formData.areaId === '0') {
|
||||
errors.areaId = true
|
||||
}
|
||||
|
||||
@ -1290,23 +1294,34 @@ export default function StuffDetail() {
|
||||
}
|
||||
|
||||
if (editMode === 'NEW') {
|
||||
await promisePost({ url: apiUrl, data: params }).then((res) => {
|
||||
//상세화면으로 전환
|
||||
if (res.status === 201) {
|
||||
alert(getMessage('stuff.detail.save'))
|
||||
setFloorPlanObjectNo({ floorPlanObjectNo: objectNo })
|
||||
router.push(`/management/stuff/detail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
||||
}
|
||||
})
|
||||
await promisePost({ url: apiUrl, data: params })
|
||||
.then((res) => {
|
||||
//상세화면으로 전환
|
||||
if (res.status === 201) {
|
||||
alert(getMessage('stuff.detail.save'))
|
||||
setFloorPlanObjectNo({ floorPlanObjectNo: objectNo })
|
||||
router.push(`/management/stuff/detail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('error::::::', error)
|
||||
alert(error?.response.data.message)
|
||||
})
|
||||
} else {
|
||||
// 수정모드일때는 PUT
|
||||
await promisePut({ url: apiUrl, data: params }).then((res) => {
|
||||
if (res.status === 201) {
|
||||
setFloorPlanObjectNo({ floorPlanObjectNo: res.data.objectNo })
|
||||
alert(getMessage('stuff.detail.save'))
|
||||
router.push(`/management/stuff/detail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
||||
}
|
||||
})
|
||||
// await promisePut({ url: apiUrl, data: params }).then((res) => {
|
||||
await promisePut({ url: apiUrl, data: params })
|
||||
.then((res) => {
|
||||
if (res.status === 201) {
|
||||
setFloorPlanObjectNo({ floorPlanObjectNo: res.data.objectNo })
|
||||
alert(getMessage('stuff.detail.save'))
|
||||
router.push(`/management/stuff/detail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('error::::::', error)
|
||||
alert(error?.response.data.message)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -1351,19 +1366,29 @@ export default function StuffDetail() {
|
||||
|
||||
const apiUrl = '/api/object/save-object'
|
||||
if (objectNo) {
|
||||
await promisePut({ url: apiUrl, data: params }).then((res) => {
|
||||
if (res.status === 201) {
|
||||
alert(getMessage('stuff.detail.tempSave.message1'))
|
||||
router.push(`/management/stuff/tempdetail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
||||
}
|
||||
})
|
||||
await promisePut({ url: apiUrl, data: params })
|
||||
.then((res) => {
|
||||
if (res.status === 201) {
|
||||
alert(getMessage('stuff.detail.tempSave.message1'))
|
||||
router.push(`/management/stuff/tempdetail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('error::::::', error)
|
||||
alert(error?.response.data.message)
|
||||
})
|
||||
} else {
|
||||
await promisePost({ url: apiUrl, data: params }).then((res) => {
|
||||
if (res.status === 201) {
|
||||
alert(getMessage('stuff.detail.tempSave.message1'))
|
||||
router.push(`/management/stuff/tempdetail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
||||
}
|
||||
})
|
||||
await promisePost({ url: apiUrl, data: params })
|
||||
.then((res) => {
|
||||
if (res.status === 201) {
|
||||
alert(getMessage('stuff.detail.tempSave.message1'))
|
||||
router.push(`/management/stuff/tempdetail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('error::::::', error)
|
||||
alert(error?.response.data.message)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user