fix: remove double /api prefix from frontend API calls
This commit is contained in:
parent
fb5dba5019
commit
01da433723
2 changed files with 7 additions and 7 deletions
|
|
@ -94,19 +94,19 @@ export default function EnvironmentDashboard() {
|
|||
try {
|
||||
// Load internal sensors and dashboard
|
||||
const [dashRes, sensorsRes] = await Promise.all([
|
||||
api.get('/api/environment/dashboard', { params: { roomId: selectedRoom || undefined } }),
|
||||
api.get('/api/environment/sensors', { params: { roomId: selectedRoom || undefined } })
|
||||
api.get('/environment/dashboard', { params: { roomId: selectedRoom || undefined } }),
|
||||
api.get('/environment/sensors', { params: { roomId: selectedRoom || undefined } })
|
||||
]);
|
||||
setDashboard(dashRes.data);
|
||||
setSensors(sensorsRes.data);
|
||||
|
||||
// Try to load Pulse data
|
||||
try {
|
||||
const pulseStatusRes = await api.get('/api/pulse/status');
|
||||
const pulseStatusRes = await api.get('/pulse/status');
|
||||
setPulseConnected(pulseStatusRes.data.connected);
|
||||
|
||||
if (pulseStatusRes.data.connected) {
|
||||
const pulseReadingsRes = await api.get('/api/pulse/readings');
|
||||
const pulseReadingsRes = await api.get('/pulse/readings');
|
||||
setPulseReadings(pulseReadingsRes.data.readings || []);
|
||||
}
|
||||
} catch (pulseError) {
|
||||
|
|
|
|||
|
|
@ -44,16 +44,16 @@ export default function PulseTestPage() {
|
|||
|
||||
try {
|
||||
// Fetch status
|
||||
const statusRes = await api.get('/api/pulse/status');
|
||||
const statusRes = await api.get('/pulse/status');
|
||||
setStatus(statusRes.data);
|
||||
|
||||
if (statusRes.data.connected) {
|
||||
// Fetch devices
|
||||
const devicesRes = await api.get('/api/pulse/devices');
|
||||
const devicesRes = await api.get('/pulse/devices');
|
||||
setDevices(devicesRes.data.devices || []);
|
||||
|
||||
// Fetch readings
|
||||
const readingsRes = await api.get('/api/pulse/readings');
|
||||
const readingsRes = await api.get('/pulse/readings');
|
||||
setReadings(readingsRes.data.readings || []);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue