From 8a1b6d787afa2493319c00f4314bd56759f86663 Mon Sep 17 00:00:00 2001 From: Louis King Date: Mon, 13 Jul 2026 16:08:51 +0100 Subject: [PATCH] fix: filter observer autocomplete to is_observer nodes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Route UI's observer search was hitting GET /api/v1/nodes without the observer filter, showing all nodes instead of only observer nodes. The backend already supports ?observer=true via an indexed column — just needed to pass the param from handleObsSearch and handleObsKeydown. --- src/meshcore_hub/web/static/js/spa/pages/routes.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/meshcore_hub/web/static/js/spa/pages/routes.js b/src/meshcore_hub/web/static/js/spa/pages/routes.js index 1701707..683ae2d 100644 --- a/src/meshcore_hub/web/static/js/spa/pages/routes.js +++ b/src/meshcore_hub/web/static/js/spa/pages/routes.js @@ -647,7 +647,7 @@ export async function render(container, params, router) { _obsSearchTimer = setTimeout(async () => { const myId = ++_obsSearchId; try { - const data = await apiGet('/api/v1/nodes', { search: q, limit: 10 }); + const data = await apiGet('/api/v1/nodes', { search: q, limit: 10, observer: true }); if (myId !== _obsSearchId) return; modalState.obsResults = data.items || []; renderPage(routes); @@ -679,11 +679,11 @@ export async function render(container, params, router) { const query = e.target.value.trim(); if (query.length < 2) return; clearTimeout(_obsSearchTimer); - const myId = ++_obsSearchId; - try { - const data = await apiGet('/api/v1/nodes', { search: query, limit: 10 }); - if (myId !== _obsSearchId) return; - modalState.obsResults = data.items || []; + const myId = ++_obsSearchId; + try { + const data = await apiGet('/api/v1/nodes', { search: query, limit: 10, observer: true }); + if (myId !== _obsSearchId) return; + modalState.obsResults = data.items || []; renderPage(routes); const filtered = modalState.obsResults.filter( n => !modalState.observerNodes.some(on => on.public_key === n.public_key)