import { request } from './request' export type SensorInfo = { id: number name: string authKey: string } export const getSensors = () => request('/api/sensors') export const createSensor = (name: string) => request('/api/sensors', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ name }), }) export const updateSensor = ({ id, ...body }: { id: number; name: string }) => request(`/api/sensors/${id}`, { method: 'PUT', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body), }) export const deleteSensor = (id: number) => request(`/api/sensors/${id}`, { method: 'DELETE' }, 'void')