물건 상세
This commit is contained in:
parent
32108583e9
commit
4114a3ca1e
@ -27,37 +27,12 @@ export default function MainPage() {
|
||||
|
||||
const [searchRadioType, setSearchRadioType] = useState('object')
|
||||
|
||||
// const [saleStoreId, setSaleStoreId] = useState('')
|
||||
// const [saleStoreName, setSaleStoreName] = useState('')
|
||||
|
||||
const [stuffSearch, setStuffSearch] = useRecoilState(stuffSearchState)
|
||||
|
||||
const [searchForm, setSearchForm] = useRecoilState(searchState)
|
||||
|
||||
const { qcastState } = useContext(QcastContext)
|
||||
|
||||
// useEffect(() => {
|
||||
// if (session.pwdInitYn === 'Y') {
|
||||
// fetchObjectList()
|
||||
// }
|
||||
// }, [session])
|
||||
|
||||
const fetchObjectList = async () => {
|
||||
try {
|
||||
const apiUrl = `/api/main-page/object/${session?.storeId}/list`
|
||||
await promiseGet({
|
||||
url: apiUrl,
|
||||
}).then((res) => {
|
||||
if (res.status === 200) {
|
||||
setSaleStoreId(res.data.saleStoreId)
|
||||
setSaleStoreName(res.data.saleStoreName)
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
console.error('MAIN API fetching error:', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 엔터 이벤트
|
||||
const handleByOnKeyUp = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
@ -68,7 +43,7 @@ export default function MainPage() {
|
||||
schObjectNo: searchTxt,
|
||||
code: 'M',
|
||||
})
|
||||
router.push('/management/stuff')
|
||||
router.push('/management/stuff', { scroll: false })
|
||||
} else {
|
||||
setSearchForm({ ...searchForm, searchValue: searchTxt, mainFlag: 'Y' })
|
||||
router.push('/community/faq')
|
||||
@ -90,7 +65,7 @@ export default function MainPage() {
|
||||
code: 'M',
|
||||
})
|
||||
|
||||
router.push('/management/stuff')
|
||||
router.push('/management/stuff', { scroll: false })
|
||||
} else {
|
||||
setSearchForm({ ...searchForm, searchValue: searchTxt, mainFlag: 'Y' })
|
||||
router.push('/community/faq')
|
||||
|
||||
@ -22,19 +22,12 @@ export default function MainContents() {
|
||||
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
||||
const { promiseGet } = useAxios(globalLocaleState)
|
||||
|
||||
//최근 물건
|
||||
// const [objectList, setObjectList] = useState([])
|
||||
|
||||
//공지사항
|
||||
const [recentNoticeList, setRecentNoticeList] = useState([])
|
||||
|
||||
//FAQ
|
||||
const [recentFaqList, setRecentFaqList] = useState([])
|
||||
|
||||
//Sales Contact info
|
||||
// const [businessCharger, setBusinessCharger] = useState(null)
|
||||
// const [businessChargerMail, setBusinessChargerMail] = useState(null)
|
||||
|
||||
const { qcastState } = useContext(QcastContext)
|
||||
const { fetchObjectList, initObjectList } = useMainContentsController()
|
||||
|
||||
@ -47,28 +40,6 @@ export default function MainContents() {
|
||||
}
|
||||
}, [])
|
||||
|
||||
//최근 갱신 물건목록 / Sales Contact info 정보
|
||||
// const fetchObjectList = async () => {
|
||||
// try {
|
||||
// const apiUrl = `/api/main-page/object/${session?.storeId}/list`
|
||||
// await promiseGet({
|
||||
// url: apiUrl,
|
||||
// }).then((res) => {
|
||||
// if (res.status === 200) {
|
||||
// setObjectList(res.data.objectList)
|
||||
// setBusinessCharger(res.data.businessCharger)
|
||||
// setBusinessChargerMail(res.data.businessChargerMail)
|
||||
// } else {
|
||||
// setObjectList([])
|
||||
// setBusinessCharger(null)
|
||||
// setBusinessChargerMail(null)
|
||||
// }
|
||||
// })
|
||||
// } catch (error) {
|
||||
// console.error('MAIN API fetching error:', error)
|
||||
// }
|
||||
// }
|
||||
|
||||
//공지사항 호출
|
||||
const fetchNoticeList = async () => {
|
||||
try {
|
||||
|
||||
@ -211,7 +211,6 @@ export default function Stuff() {
|
||||
fetchData()
|
||||
} else if (stuffSearchParams?.code === 'M') {
|
||||
const params = {
|
||||
saleStoreId: session?.storeId,
|
||||
schObjectNo: stuffSearchParams.schObjectNo,
|
||||
schAddress: '',
|
||||
schObjectName: '',
|
||||
@ -225,7 +224,7 @@ export default function Stuff() {
|
||||
endRow: pageNo * pageSize,
|
||||
schSelSaleStoreId: stuffSearchParams?.schOtherSelSaleStoreId ? stuffSearchParams.schOtherSelSaleStoreId : stuffSearchParams.schSelSaleStoreId,
|
||||
schSortType: 'R',
|
||||
code: 'S',
|
||||
code: 'E',
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
}
|
||||
@ -338,7 +337,6 @@ export default function Stuff() {
|
||||
|
||||
//최근 등록일 수정일 정렬 이벤트
|
||||
const onChangeSortType = (e) => {
|
||||
// let startRow = (stuffSearchParams.pageNo - 1) * pageSize + 1
|
||||
let startRow = (1 - 1) * stuffSearchParams.pageSize + 1
|
||||
stuffSearchParams.startRow = startRow
|
||||
stuffSearchParams.endRow = startRow * stuffSearchParams.pageSize
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user