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:
rafaeldpsilva
2025-09-25 14:48:48 +01:00
parent 6510468768
commit 326746b5ef
7 changed files with 445 additions and 369 deletions

View File

@@ -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> {