chore: models & requests
This commit is contained in:
@@ -4,10 +4,21 @@ import type { NdmMediaServerPageQuery, NdmMediaServerResultVO, NdmMediaServerUpd
|
||||
import { ndmClient } from '@/apis/client';
|
||||
|
||||
export const postNdmMediaServerPage = async (stationCode: string, pageQuery: PageParams<NdmMediaServerPageQuery>) => {
|
||||
const resp = await ndmClient.post<PageResult<NdmMediaServerResultVO>>(`${stationCode}/api/ndm/ndmMediaServer/page`, pageQuery);
|
||||
return resp;
|
||||
const prefix = stationCode ? `/${stationCode}` : '';
|
||||
const resp = await ndmClient.post<PageResult<NdmMediaServerResultVO>>(`${prefix}/api/ndm/ndmMediaServer/page`, pageQuery);
|
||||
const [err, ndmMediaServerData] = resp;
|
||||
if (err || !ndmMediaServerData) {
|
||||
throw err;
|
||||
}
|
||||
return ndmMediaServerData;
|
||||
};
|
||||
|
||||
export const putNdmMediaServer = async (stationCode: string, updateVO: NdmMediaServerUpdateVO) => {
|
||||
const resp = await ndmClient.put<NdmMediaServerResultVO>(`${stationCode}/api/ndm/ndmMediaServer`, updateVO);
|
||||
return resp;
|
||||
const prefix = stationCode ? `/${stationCode}` : '';
|
||||
const resp = await ndmClient.put<NdmMediaServerResultVO>(`${prefix}/api/ndm/ndmMediaServer`, updateVO);
|
||||
const [err, ndmMediaServer] = resp;
|
||||
if (err || !ndmMediaServer) {
|
||||
throw err;
|
||||
}
|
||||
return ndmMediaServer;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user