fix: 문의 유형 공통코드 개별 조회 로직 삭제

- 문의 공통코드 타입 변경으로 인한 오류 수정
This commit is contained in:
Dayoung 2025-08-07 15:18:45 +09:00
parent 244c67ae1e
commit 52c52d13f4
2 changed files with 3 additions and 34 deletions

View File

@ -1,5 +1,4 @@
import { SessionData } from '@/types/Auth'
import { CommonCode, InquiryRequest } from '@/types/Inquiry'
import { ERROR_MESSAGE } from '@/hooks/useAlertMsg'
import { HttpStatusCode } from 'axios'
import { ApiError } from 'next/dist/server/api-utils'
@ -55,36 +54,6 @@ export class QnaService {
return new ApiError(response.result.code, response.result.message)
}
/**
* @description
* @param {string[]} responseList
* @returns {CommonCode[]}
*/
getInquiryTypeList(responseList: any): CommonCode[] {
const codeList: CommonCode[] = []
const headCdList: { headCd: string; headId: string }[] = []
responseList.apiHeadCdList.forEach((item: any) => {
if (item.headId === 'QNA_CLS_LRG_CD' || item.headId === 'QNA_CLS_MID_CD' || item.headId === 'QNA_CLS_SML_CD') {
headCdList.push({
headCd: item.headCd,
headId: item.headId,
})
}
})
responseList.apiCommCdList.forEach((item: any) => {
if (headCdList.some((headCd) => headCd.headCd === item.headCd)) {
codeList.push({
headCd: item.headCd,
headId: headCdList.find((headCd) => headCd.headCd === item.headCd)?.headId ?? '',
code: item.code,
name: item.codeJp,
refChar1: item.refChr1,
})
}
})
return codeList
}
/**
* @description
* @param {URLSearchParams} searchParams URLSearchParams

View File

@ -61,9 +61,9 @@ export default function Detail() {
</div>
<div className="inquiry-detail-data">
<div className="inquiry-detail-category">
<span>{commonCodeList.find((code) => code.code === inquiryDetail?.qnaClsLrgCd)?.name}</span>
<span>{commonCodeList.find((code) => code.code === inquiryDetail?.qnaClsMidCd)?.name}</span>
<span>{commonCodeList.find((code) => code.code === inquiryDetail?.qnaClsSmlCd)?.name}</span>
<span>{commonCodeList.find((code) => code.code === inquiryDetail?.qnaClsLrgCd)?.codeJp}</span>
<span>{commonCodeList.find((code) => code.code === inquiryDetail?.qnaClsMidCd)?.codeJp}</span>
<span>{commonCodeList.find((code) => code.code === inquiryDetail?.qnaClsSmlCd)?.codeJp}</span>
</div>
<div className="inquiry-detail-tit">{inquiryDetail?.qstTitle}</div>
<div className="inquiry-detail-txt">{inquiryDetail?.qstContents}</div>