Refactor API and store logic for sensor and room management
- Add sensor name to SensorInfo interface - Update API client to conditionally include auth headers - Add saveToken endpoint to authApi - Refactor roomsApi to use getRoomNames endpoint - Change sensorsApi to use /api/v1/sensors/get - Improve token handling and JWT decoding in auth store - Refactor room loading to use API client in energy store - Add helper to transform API sensor data - Update SensorManagementView to load sensors from API and fix filtering
This commit is contained in:
@@ -14,7 +14,7 @@ export const sensorsApi = {
|
||||
sensor_type?: SensorType
|
||||
status?: SensorStatus
|
||||
}): Promise<SensorInfo[]> {
|
||||
return apiClient.get<SensorInfo[]>('/api/v1/sensors', params)
|
||||
return apiClient.get<SensorInfo[]>('/api/v1/sensors/get', params)
|
||||
},
|
||||
|
||||
async getSensor(sensorId: string): Promise<SensorInfo> {
|
||||
|
||||
Reference in New Issue
Block a user