Remove API documentation file and update navigation constants with new entries for farm dashboard, water data, soil data, and data section. Enhance sensor hub functionality by adding new sensor payload structure and integrating plant type and name selection in the sensor form. Refactor calendar components to streamline code and improve maintainability.
This commit is contained in:
@@ -17,7 +17,23 @@ export interface ListSensorsResponse {
|
||||
data: Sensor | Sensor[]
|
||||
}
|
||||
|
||||
export interface AddSensorPayload {
|
||||
name: string
|
||||
uuid_sensor: string
|
||||
area_geojson?: Record<string, unknown>
|
||||
area_m2?: number
|
||||
}
|
||||
|
||||
export const sensorHubService = {
|
||||
/**
|
||||
* Add a new sensor
|
||||
*/
|
||||
async addSensor(payload: AddSensorPayload): Promise<Sensor> {
|
||||
const response = await apiClient.post<{ data?: Sensor }>('/api/sensor-hub/', payload)
|
||||
|
||||
return (response?.data as Sensor) ?? (payload as unknown as Sensor)
|
||||
},
|
||||
|
||||
/**
|
||||
* Get list of sensors
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user