20 lines
648 B
TypeScript

import { NextResponse } from 'next/server'
import axios from 'axios'
import { CommonCode } from '@/types/Inquiry'
export async function GET() {
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 })
}