Compare commits
No commits in common. "fd35348694421299cdb51ea0e4930f3fe401e345" and "d79fc4a23a58f871b38519bcd0186b76a06c5072" have entirely different histories.
fd35348694
...
d79fc4a23a
@ -38,7 +38,7 @@ async function getCommonCodeListData(): Promise<NextResponse> {
|
||||
if (response instanceof ApiError) {
|
||||
return NextResponse.json({ error: response.message }, { status: response.statusCode })
|
||||
}
|
||||
const result = service.getInquiryTypeList(response.data)
|
||||
const result = service.getInquiryTypeList(response.data.apiCommCdList)
|
||||
return NextResponse.json({ data: result })
|
||||
}
|
||||
|
||||
|
||||
@ -57,22 +57,12 @@ export class QnaService {
|
||||
* @param {string[]} responseList 문의 유형 타입 목록
|
||||
* @returns {CommonCode[]} 문의 유형 타입 목록
|
||||
*/
|
||||
getInquiryTypeList(responseList: any): CommonCode[] {
|
||||
getInquiryTypeList(responseList: string[]): 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)) {
|
||||
responseList.forEach((item: any) => {
|
||||
if (item.headCd === '204200' || item.headCd === '204300' || item.headCd === '204400') {
|
||||
codeList.push({
|
||||
headCd: item.headCd,
|
||||
headId: headCdList.find((headCd) => headCd.headCd === item.headCd)?.headId ?? '',
|
||||
code: item.code,
|
||||
name: item.codeJp,
|
||||
refChar1: item.refChr1,
|
||||
@ -122,7 +112,8 @@ export class QnaService {
|
||||
return this.tryFunction(() => {
|
||||
return sendEmail({
|
||||
from: 'test@test.com',
|
||||
to: receivers,
|
||||
// to: receivers,
|
||||
to: 'keyy1315@interplug.co.kr',
|
||||
subject: `[HANASYS お問い合わせ] ${formData.get('title')}`,
|
||||
content: this.generateEmailContent(formData),
|
||||
attachments: attachments,
|
||||
|
||||
@ -153,7 +153,7 @@ export default function RegistForm() {
|
||||
選択してください
|
||||
</option>
|
||||
{commonCodeList
|
||||
.filter((code) => code.headId === 'QNA_CLS_LRG_CD')
|
||||
.filter((code) => code.headCd === '204200')
|
||||
.map((code) => (
|
||||
<option key={code.code} value={code.code}>
|
||||
{code.name}
|
||||
|
||||
@ -185,7 +185,6 @@ export type InquirySaveResponse = {
|
||||
*/
|
||||
export type CommonCode = {
|
||||
headCd: string
|
||||
headId: string
|
||||
code: string
|
||||
name: string
|
||||
refChar1: string
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user