Fix list filters + align API params to the concatenated convention

Backends read snake_case filter params (type_id, vendor_id, location_id,
businessunit_id, status_id, os_id) while the frontend sends the concatenated
form (typeid, vendorid, ...), so the network/notifications/printers list
filters silently did nothing. Backends now read the concatenated name with a
snake_case fallback (no breakage), matching the locked naming convention.

Verified: network type filter now narrows results (45 -> 25 for Access Points).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
cproudlock
2026-06-26 12:36:47 -04:00
parent 820d3650ff
commit fc93506af3
6 changed files with 1865 additions and 1865 deletions

View File

@@ -163,19 +163,19 @@ def list_network_devices():
)
# Type filter
if type_id := request.args.get('type_id'):
if type_id := request.args.get('typeid', request.args.get('type_id')):
query = query.filter(NetworkDevice.networkdevicetypeid == int(type_id))
# Vendor filter
if vendor_id := request.args.get('vendor_id'):
if vendor_id := request.args.get('vendorid', request.args.get('vendor_id')):
query = query.filter(NetworkDevice.vendorid == int(vendor_id))
# Location filter
if location_id := request.args.get('location_id'):
if location_id := request.args.get('locationid', request.args.get('location_id')):
query = query.filter(Asset.locationid == int(location_id))
# Business unit filter
if bu_id := request.args.get('businessunit_id'):
if bu_id := request.args.get('businessunitid', request.args.get('businessunit_id')):
query = query.filter(Asset.businessunitid == int(bu_id))
# PoE filter