23 lines
806 B
TypeScript
23 lines
806 B
TypeScript
import { NextResponse } from 'next/server'
|
|
import axios from 'axios'
|
|
import { CommonCode } from '@/types/Inquiry'
|
|
import { loggerWrapper } from '@/libs/api-wrapper'
|
|
|
|
async function getCommonCodeListData(request: Request): Promise<NextResponse> {
|
|
const response = await axios.get(`${process.env.NEXT_PUBLIC_INQUIRY_API_URL}/api/system/commonCodeListData`)
|
|
const codeList: CommonCode[] = []
|
|
response.data.data.apiCommCdList.forEach((item: any) => {
|
|
if (item.headCd === '204200' || item.headCd === '204300' || item.headCd === '204400') {
|
|
codeList.push({
|
|
headCd: item.headCd,
|
|
code: item.code,
|
|
name: item.codeJp,
|
|
refChar1: item.refChr1,
|
|
})
|
|
}
|
|
})
|
|
return NextResponse.json({ data: codeList })
|
|
}
|
|
|
|
export const GET = loggerWrapper(getCommonCodeListData)
|