[object Object]

← back to Nationalrealestate

brokers: license_status filter (?status=active) on /api/brokers + Active-only UI toggle on directory

a74ceb327ea645ce1f5eee59169b8451751a3093 · 2026-07-26 08:13:32 -0700 · Steve Abrams

Leverages the CT full-roster upgrade (status now populated on 97k CT + FL/DE/IL brokers) so the directory can show active licensees only. localStorage-persisted, matches existing srvbar controls.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit a74ceb327ea645ce1f5eee59169b8451751a3093
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Sun Jul 26 08:13:32 2026 -0700

    brokers: license_status filter (?status=active) on /api/brokers + Active-only UI toggle on directory
    
    Leverages the CT full-roster upgrade (status now populated on 97k CT + FL/DE/IL brokers) so the directory can show active licensees only. localStorage-persisted, matches existing srvbar controls.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 public/brokers.html | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/public/brokers.html b/public/brokers.html
index e1da3a6..982fe4e 100644
--- a/public/brokers.html
+++ b/public/brokers.html
@@ -70,6 +70,12 @@
 <div id="srvbar">
   <input type="text" id="srvQ" placeholder="search name / firm / license # (server-side)">
   <input type="text" id="srvFirm" placeholder="firm filter" style="min-width:160px">
+  <select id="srvStatus" title="License status filter">
+    <option value="">All statuses</option>
+    <option value="active">Active only</option>
+    <option value="inactive">Inactive</option>
+    <option value="expired application">Expired application</option>
+  </select>
   <span id="pager">
     <button id="pgPrev">‹ Prev</button>
     <span id="pgInfo">—</span>
@@ -87,7 +93,7 @@
 const PAGE = 500;
 const LS = { get(k){ try { return localStorage.getItem(k); } catch { return null; } },
              set(k,v){ try { localStorage.setItem(k,v); } catch {} } };
-const S = { state: LS.get('usreBrk.state') || '', q: '', firm: '', offset: 0, total: 0 };
+const S = { state: LS.get('usreBrk.state') || '', q: '', firm: '', status: LS.get('usreBrk.status') || '', offset: 0, total: 0 };
 
 const FIELDS = [
   { k: 'license_no',     l: 'License #', def: 1, col: 1 },
@@ -128,6 +134,7 @@ async function loadPage() {
   if (S.state) p.set('state', S.state);
   if (S.q) p.set('q', S.q);
   if (S.firm) p.set('firm', S.firm);
+  if (S.status) p.set('status', S.status);
   p.set('limit', PAGE); p.set('offset', S.offset);
   const d = await fetch('/api/brokers?' + p).then(r => r.json());
   S.total = d.total || 0;
@@ -227,6 +234,8 @@ async function toggleFirmDetail(row, el) {
 const deb = (fn, ms) => { let t; return (...a) => { clearTimeout(t); t = setTimeout(() => fn(...a), ms); }; };
 document.getElementById('srvQ').addEventListener('input', deb(e => { S.q = e.target.value.trim(); S.offset = 0; loadPage(); }, 350));
 document.getElementById('srvFirm').addEventListener('input', deb(e => { S.firm = e.target.value.trim(); S.offset = 0; loadPage(); }, 350));
+{ const el = document.getElementById('srvStatus'); el.value = S.status;
+  el.addEventListener('change', e => { S.status = e.target.value; LS.set('usreBrk.status', S.status); S.offset = 0; loadPage(); }); }
 document.getElementById('pgPrev').addEventListener('click', () => { S.offset = Math.max(S.offset - PAGE, 0); loadPage(); });
 document.getElementById('pgNext').addEventListener('click', () => { S.offset += PAGE; loadPage(); });
 

← 4b82a3d auto-save: 2026-07-26T08:11:40 (1 files) — src/server/index.  ·  back to Nationalrealestate  ·  ct_dcp: normalize credential code to canonical RES.# source_ c452e2e →