fix: reports page — add asset lat/lng to /api/visits for map button, fix null field guard in form error handler
This commit is contained in:
@@ -2611,7 +2611,7 @@ def list_visits(
|
|||||||
params.append(date_to + " 23:59:59")
|
params.append(date_to + " 23:59:59")
|
||||||
|
|
||||||
where = " AND ".join(conditions)
|
where = " AND ".join(conditions)
|
||||||
sql = """SELECT v.*, a.name AS asset_name, a.machine_id,
|
sql = """SELECT v.*, a.name AS asset_name, a.machine_id, a.latitude, a.longitude,
|
||||||
u.username AS user_name
|
u.username AS user_name
|
||||||
FROM visits v
|
FROM visits v
|
||||||
LEFT JOIN assets a ON v.asset_id = a.id
|
LEFT JOIN assets a ON v.asset_id = a.id
|
||||||
|
|||||||
+1
-1
@@ -3927,7 +3927,7 @@
|
|||||||
if (field) field.classList.add('error');
|
if (field) field.classList.add('error');
|
||||||
if (errEl) { errEl.textContent = '⚠️ ' + msg; errEl.classList.add('visible'); }
|
if (errEl) { errEl.textContent = '⚠️ ' + msg; errEl.classList.add('visible'); }
|
||||||
// Mark parent section
|
// Mark parent section
|
||||||
const section = field.closest('.form-collapse-section');
|
const section = field ? field.closest('.form-collapse-section') : null;
|
||||||
if (section) { section.classList.add('has-error'); openFormSection(section.id); }
|
if (section) { section.classList.add('has-error'); openFormSection(section.id); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user