[main] fix: fetchNoticeList·fetchFaqList catch 블록 스코프 오류 수정 — param·apiUrl 선언을 try 밖으로 이동
This commit is contained in:
parent
e79ee3dc52
commit
b031e703ec
@ -80,14 +80,14 @@ export default function MainContents({ setFaqOpen, setFaqModalNoticeNo }) {
|
|||||||
|
|
||||||
//공지사항 호출
|
//공지사항 호출
|
||||||
const fetchNoticeList = async () => {
|
const fetchNoticeList = async () => {
|
||||||
|
const param = {
|
||||||
|
schNoticeTpCd: 'QC',
|
||||||
|
schNoticeClsCd: 'NOTICE',
|
||||||
|
startRow: 1,
|
||||||
|
endRow: 1,
|
||||||
|
}
|
||||||
|
const noticeApiUrl = `api/board/list?${queryStringFormatter(param)}`
|
||||||
try {
|
try {
|
||||||
const param = {
|
|
||||||
schNoticeTpCd: 'QC',
|
|
||||||
schNoticeClsCd: 'NOTICE',
|
|
||||||
startRow: 1,
|
|
||||||
endRow: 1,
|
|
||||||
}
|
|
||||||
const noticeApiUrl = `api/board/list?${queryStringFormatter(param)}`
|
|
||||||
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,14 +111,14 @@ export default function MainContents({ setFaqOpen, setFaqModalNoticeNo }) {
|
|||||||
|
|
||||||
//FAQ 호출
|
//FAQ 호출
|
||||||
const fetchFaqList = async () => {
|
const fetchFaqList = async () => {
|
||||||
|
const param = {
|
||||||
|
schNoticeTpCd: 'QC',
|
||||||
|
schNoticeClsCd: 'FAQ',
|
||||||
|
startRow: 1,
|
||||||
|
endRow: 3,
|
||||||
|
}
|
||||||
|
const faqApiUrl = `api/board/list?${queryStringFormatter(param)}`
|
||||||
try {
|
try {
|
||||||
const param = {
|
|
||||||
schNoticeTpCd: 'QC',
|
|
||||||
schNoticeClsCd: 'FAQ',
|
|
||||||
startRow: 1,
|
|
||||||
endRow: 3,
|
|
||||||
}
|
|
||||||
const faqApiUrl = `api/board/list?${queryStringFormatter(param)}`
|
|
||||||
await promiseGet({
|
await promiseGet({
|
||||||
url: faqApiUrl,
|
url: faqApiUrl,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user