Merge Q-CAST-III-MR-498: alert창 변경

This commit is contained in:
상연 정 2025-01-07 07:49:48 +00:00 committed by Space Cloud
commit 32cbeb99eb
No known key found for this signature in database
GPG Key ID: 2F4D45726235F749
2 changed files with 14 additions and 7 deletions

View File

@ -332,7 +332,7 @@ export default function StuffDetail() {
//createUser T01 T01
setShowButton('none')
}
// console.log('::', res.data)
if (isObjectNotEmpty(res.data)) {
let surfaceTypeValue
if (res.data.surfaceType === 'Ⅲ・Ⅳ') {

View File

@ -9,7 +9,7 @@ import { useMessage } from '@/hooks/useMessage'
import { useRouter } from 'next/navigation'
import { FloorPlanContext } from '@/app/floor-plan/FloorPlanProvider'
import { QcastContext } from '@/app/QcastProvider'
import { useSwal } from '@/hooks/useSwal'
// Constants
const ESTIMATE_API_ENDPOINT = '/api/estimate' // API 엔드포인트 정의
@ -19,6 +19,7 @@ const updateItemInList = (itemList, dispOrder, updates) => {
}
export const useEstimateController = (planNo) => {
const { swalFire } = useSwal()
const [fileList, setFileList] = useState([])
const { setIsGlobalLoading } = useContext(QcastContext)
@ -353,7 +354,6 @@ export const useEstimateController = (planNo) => {
estimateData.pkgAsp = estimateData.pkgAsp.replaceAll(',', '')
}
console.log('최종저장::', estimateData)
//2. 상세데이터 저장
// return
try {
@ -361,8 +361,9 @@ export const useEstimateController = (planNo) => {
setIsGlobalLoading(true)
if (res.status === 201) {
estimateData.newFileList = []
alert(getMessage('estimate.detail.save.alertMsg'))
//어디로 보낼지
//알럿창 변경
swalFire({ text: getMessage('estimate.detail.save.alertMsg'), type: 'alert' })
// alert(getMessage('estimate.detail.save.alertMsg'))
fetchSetting(objectRecoil.floorPlanObjectNo, estimateData.planNo)
}
})
@ -400,8 +401,14 @@ export const useEstimateController = (planNo) => {
if (res.status === 201) {
if (isObjectNotEmpty(res.data)) {
let newObjectNo = res.data.objectNo
alert(getMessage('estimate.detail.estimateCopyPopup.copy.alertMessage'))
router.push(`/management/stuff/detail?objectNo=${newObjectNo.toString()}`, { scroll: false })
console.log('newObjectNo::', newObjectNo)
swalFire({
text: getMessage('estimate.detail.estimateCopyPopup.copy.alertMessage'),
type: 'alert',
confirmFn: () => {
router.push(`/management/stuff/detail?objectNo=${newObjectNo.toString()}`, { scroll: false })
},
})
}
}
})