import { apiClient } from "./client"; import type { ApiResponse } from "@/types/api"; import type { DeviceListRequest, DeviceListResponse, DeviceDeleteRequest, DeviceExportRequest, } from "@/features/device/types"; /** 기기 목록 조회 (X-Service-Code 선택) */ export function fetchDevices( data: DeviceListRequest, serviceCode?: string, ) { return apiClient.post>( "/v1/in/device/list", data, serviceCode ? { headers: { "X-Service-Code": serviceCode } } : undefined, ); } /** 기기 삭제 (비활성화) */ export function deleteDevice( data: DeviceDeleteRequest, serviceCode: string, ) { return apiClient.post>( "/v1/in/device/admin/delete", data, { headers: { "X-Service-Code": serviceCode } }, ); } /** 기기 내보내기 (xlsx blob) */ export function exportDevices( data: DeviceExportRequest, serviceCode: string, ) { return apiClient.post("/v1/in/device/export", data, { headers: { "X-Service-Code": serviceCode }, responseType: "blob", }); }