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 {
|
try {
|
||||||
// Load internal sensors and dashboard
|
// Load internal sensors and dashboard
|
||||||
const [dashRes, sensorsRes] = await Promise.all([
|
const [dashRes, sensorsRes] = await Promise.all([
|
||||||
api.get('/api/environment/dashboard', { params: { roomId: selectedRoom || undefined } }),
|
api.get('/environment/dashboard', { params: { roomId: selectedRoom || undefined } }),
|
||||||
api.get('/api/environment/sensors', { params: { roomId: selectedRoom || undefined } })
|
api.get('/environment/sensors', { params: { roomId: selectedRoom || undefined } })
|
||||||
]);
|
]);
|
||||||
setDashboard(dashRes.data);
|
setDashboard(dashRes.data);
|
||||||
setSensors(sensorsRes.data);
|
setSensors(sensorsRes.data);
|
||||||
|
|
||||||
// Try to load Pulse data
|
// Try to load Pulse data
|
||||||
try {
|
try {
|
||||||
const pulseStatusRes = await api.get('/api/pulse/status');
|
const pulseStatusRes = await api.get('/pulse/status');
|
||||||
setPulseConnected(pulseStatusRes.data.connected);
|
setPulseConnected(pulseStatusRes.data.connected);
|
||||||
|
|
||||||
if (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 || []);
|
setPulseReadings(pulseReadingsRes.data.readings || []);
|
||||||
}
|
}
|
||||||
} catch (pulseError) {
|
} catch (pulseError) {
|
||||||
|
|
|
||||||
|
|
@ -44,16 +44,16 @@ export default function PulseTestPage() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Fetch status
|
// Fetch status
|
||||||
const statusRes = await api.get('/api/pulse/status');
|
const statusRes = await api.get('/pulse/status');
|
||||||
setStatus(statusRes.data);
|
setStatus(statusRes.data);
|
||||||
|
|
||||||
if (statusRes.data.connected) {
|
if (statusRes.data.connected) {
|
||||||
// Fetch devices
|
// Fetch devices
|
||||||
const devicesRes = await api.get('/api/pulse/devices');
|
const devicesRes = await api.get('/pulse/devices');
|
||||||
setDevices(devicesRes.data.devices || []);
|
setDevices(devicesRes.data.devices || []);
|
||||||
|
|
||||||
// Fetch readings
|
// Fetch readings
|
||||||
const readingsRes = await api.get('/api/pulse/readings');
|
const readingsRes = await api.get('/pulse/readings');
|
||||||
setReadings(readingsRes.data.readings || []);
|
setReadings(readingsRes.data.readings || []);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue