fix: 문의 유형 공통코드 개별 조회 로직 삭제 #129
@ -1,5 +1,4 @@
|
|||||||
import { SessionData } from '@/types/Auth'
|
import { SessionData } from '@/types/Auth'
|
||||||
import { CommonCode, InquiryRequest } from '@/types/Inquiry'
|
|
||||||
import { ERROR_MESSAGE } from '@/hooks/useAlertMsg'
|
import { ERROR_MESSAGE } from '@/hooks/useAlertMsg'
|
||||||
import { HttpStatusCode } from 'axios'
|
import { HttpStatusCode } from 'axios'
|
||||||
import { ApiError } from 'next/dist/server/api-utils'
|
import { ApiError } from 'next/dist/server/api-utils'
|
||||||
@ -55,36 +54,6 @@ export class QnaService {
|
|||||||
return new ApiError(response.result.code, response.result.message)
|
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 문의 목록 조회 파라미터 처리
|
* @description 문의 목록 조회 파라미터 처리
|
||||||
* @param {URLSearchParams} searchParams URLSearchParams 객체
|
* @param {URLSearchParams} searchParams URLSearchParams 객체
|
||||||
|
|||||||
@ -61,9 +61,9 @@ export default function Detail() {
|
|||||||
</div>
|
</div>
|
||||||
<div className="inquiry-detail-data">
|
<div className="inquiry-detail-data">
|
||||||
<div className="inquiry-detail-category">
|
<div className="inquiry-detail-category">
|
||||||
<span>{commonCodeList.find((code) => code.code === inquiryDetail?.qnaClsLrgCd)?.name}</span>
|
<span>{commonCodeList.find((code) => code.code === inquiryDetail?.qnaClsLrgCd)?.codeJp}</span>
|
||||||
<span>{commonCodeList.find((code) => code.code === inquiryDetail?.qnaClsMidCd)?.name}</span>
|
<span>{commonCodeList.find((code) => code.code === inquiryDetail?.qnaClsMidCd)?.codeJp}</span>
|
||||||
<span>{commonCodeList.find((code) => code.code === inquiryDetail?.qnaClsSmlCd)?.name}</span>
|
<span>{commonCodeList.find((code) => code.code === inquiryDetail?.qnaClsSmlCd)?.codeJp}</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="inquiry-detail-tit">{inquiryDetail?.qstTitle}</div>
|
<div className="inquiry-detail-tit">{inquiryDetail?.qstTitle}</div>
|
||||||
<div className="inquiry-detail-txt">{inquiryDetail?.qstContents}</div>
|
<div className="inquiry-detail-txt">{inquiryDetail?.qstContents}</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user