Merge Q-CAST-III-MR-721: Home 소스정리
This commit is contained in:
commit
f00ea2648a
@ -12,13 +12,10 @@ import { globalLocaleStore } from '@/store/localeAtom'
|
||||
import { queryStringFormatter } from '@/util/common-utils'
|
||||
import { useMainContentsController } from '@/hooks/main/useMainContentsController'
|
||||
import { QcastContext } from '@/app/QcastProvider'
|
||||
import { useSwal } from '@/hooks/useSwal'
|
||||
|
||||
import { handleFileDown } from '@/util/board-utils'
|
||||
|
||||
export default function MainContents({ setFaqOpen, setFaqModalNoticeNo }) {
|
||||
const { swalFire } = useSwal()
|
||||
|
||||
const { getMessage } = useMessage()
|
||||
const router = useRouter()
|
||||
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
||||
@ -33,7 +30,7 @@ export default function MainContents({ setFaqOpen, setFaqModalNoticeNo }) {
|
||||
const { fetchObjectList, initObjectList } = useMainContentsController()
|
||||
|
||||
//첨부파일
|
||||
const [boardList, setBoardList] = useState([])
|
||||
const [fileList, setFileList] = useState([])
|
||||
useEffect(() => {
|
||||
fetchObjectList()
|
||||
fetchNoticeList()
|
||||
@ -62,9 +59,7 @@ export default function MainContents({ setFaqOpen, setFaqModalNoticeNo }) {
|
||||
|
||||
if (resultData) {
|
||||
if (resultData.result.code === 200) {
|
||||
setBoardList(resultData.data)
|
||||
} else {
|
||||
alert(resultData.result.message)
|
||||
setFileList(resultData.data)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -205,11 +200,11 @@ export default function MainContents({ setFaqOpen, setFaqModalNoticeNo }) {
|
||||
)}
|
||||
</ProductItem>
|
||||
<ProductItem num={4} name={'Data Download'}>
|
||||
{boardList.length > 0 ? (
|
||||
{fileList.length > 0 ? (
|
||||
<div className="data-download-wrap">
|
||||
{boardList?.map((board) => (
|
||||
<button type="button" key={board.noticeNo} className="data-down" onClick={() => handleFileDown(board.noticeNo, 'Y')}>
|
||||
<span>{board.title}</span>
|
||||
{fileList?.map((file) => (
|
||||
<button type="button" key={file.noticeNo} className="data-down" onClick={() => handleFileDown(file.noticeNo, 'Y')}>
|
||||
<span>{file.title}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user