[main] fix: fetchNoticeList·fetchFaqList catch 블록 스코프 오류 수정 — param·apiUrl 선언을 try 밖으로 이동

This commit is contained in:
ysCha 2026-06-26 14:36:34 +09:00
parent e79ee3dc52
commit b031e703ec

View File

@ -80,7 +80,6 @@ export default function MainContents({ setFaqOpen, setFaqModalNoticeNo }) {
// //
const fetchNoticeList = async () => { const fetchNoticeList = async () => {
try {
const param = { const param = {
schNoticeTpCd: 'QC', schNoticeTpCd: 'QC',
schNoticeClsCd: 'NOTICE', schNoticeClsCd: 'NOTICE',
@ -88,6 +87,7 @@ export default function MainContents({ setFaqOpen, setFaqModalNoticeNo }) {
endRow: 1, endRow: 1,
} }
const noticeApiUrl = `api/board/list?${queryStringFormatter(param)}` const noticeApiUrl = `api/board/list?${queryStringFormatter(param)}`
try {
await promiseGet({ url: noticeApiUrl }).then((res) => { await promiseGet({ url: noticeApiUrl }).then((res) => {
if (res.status === 200) { if (res.status === 200) {
setRecentNoticeList(res.data.data) setRecentNoticeList(res.data.data)
@ -111,7 +111,6 @@ export default function MainContents({ setFaqOpen, setFaqModalNoticeNo }) {
//FAQ //FAQ
const fetchFaqList = async () => { const fetchFaqList = async () => {
try {
const param = { const param = {
schNoticeTpCd: 'QC', schNoticeTpCd: 'QC',
schNoticeClsCd: 'FAQ', schNoticeClsCd: 'FAQ',
@ -119,6 +118,7 @@ export default function MainContents({ setFaqOpen, setFaqModalNoticeNo }) {
endRow: 3, endRow: 3,
} }
const faqApiUrl = `api/board/list?${queryStringFormatter(param)}` const faqApiUrl = `api/board/list?${queryStringFormatter(param)}`
try {
await promiseGet({ await promiseGet({
url: faqApiUrl, url: faqApiUrl,
}).then((res) => { }).then((res) => {