feat(dashboard): export devices
This commit is contained in:
17
src/apis/requests/device/export/ndm-icmp-export.ts
Normal file
17
src/apis/requests/device/export/ndm-icmp-export.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { ndmClient } from '@/apis/client';
|
||||
|
||||
export const ndmExportDevices = async (status?: string) => {
|
||||
const endpoint = '/api/ndm/ndmIcmpExport/exportByTemplate';
|
||||
const body = new URLSearchParams();
|
||||
body.append('status', status ?? '');
|
||||
const resp = await ndmClient.post<Blob>(endpoint, body, {
|
||||
responseType: 'blob',
|
||||
retRaw: true,
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
});
|
||||
const [err, data] = resp;
|
||||
if (err || !data) {
|
||||
throw err;
|
||||
}
|
||||
return data;
|
||||
};
|
||||
Reference in New Issue
Block a user