import { ndmClient } from '@/apis/client'; import type { PageParams, NdmDecoderPageQuery, PageResult, NdmDecoderResultVO, NdmDecoderUpdateVO } from '@/apis/models'; export const postNdmDecoderPage = async (stationCode: string, pageQuery: PageParams, signal?: AbortSignal) => { const prefix = stationCode ? `/${stationCode}` : ''; const resp = await ndmClient.post>(`${prefix}/api/ndm/ndmDecoder/page`, pageQuery, { signal }); const [err, ndmDecoderData] = resp; if (err || !ndmDecoderData) { throw err; } return ndmDecoderData; }; export const putNdmDecoder = async (stationCode: string, updateVO: NdmDecoderUpdateVO) => { const prefix = stationCode ? `/${stationCode}` : ''; const resp = await ndmClient.put(`${prefix}/api/ndm/ndmDecoder`, updateVO); const [err, ndmDecoder] = resp; if (err || !ndmDecoder) { throw err; } return ndmDecoder; };