Fix: samakan format parsing response dengan event.html, tambah logging detail
This commit is contained in:
@@ -504,7 +504,12 @@ async function loadSummaryAndCharts() {
|
||||
async function loadGatesForCamera() {
|
||||
try {
|
||||
const response = await apiGetGates(null, { limit: 1000 });
|
||||
let gates = Array.isArray(response) ? response : (response && Array.isArray(response.data) ? response.data : []);
|
||||
let gates = [];
|
||||
if (Array.isArray(response)) {
|
||||
gates = response;
|
||||
} else if (response && Array.isArray(response.data)) {
|
||||
gates = response.data;
|
||||
}
|
||||
|
||||
gatesCache = {};
|
||||
gates.forEach(gate => {
|
||||
@@ -526,7 +531,7 @@ async function loadGatesForCamera() {
|
||||
}
|
||||
});
|
||||
|
||||
console.log('[Dashboard] Gates dengan camera loaded:', Object.keys(gatesCache).length);
|
||||
console.log('[Dashboard] Gates dengan camera loaded:', Object.keys(gatesCache).length, gatesCache);
|
||||
} catch (err) {
|
||||
console.error('[Dashboard] Error loading gates for camera:', err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user