diff --git a/server.py b/server.py index 2ddbb1d..fe69380 100644 --- a/server.py +++ b/server.py @@ -928,8 +928,9 @@ def list_assets( customer_id: Optional[int] = Query(None), location_id: Optional[int] = Query(None), assigned_to: Optional[int] = Query(None), + disney_park: Optional[str] = Query(None), q: Optional[str] = Query(None), - limit: int = Query(100, ge=1, le=1000), + limit: int = Query(100, ge=1, le=2000), offset: int = Query(0, ge=0), ): conn = get_db() @@ -945,6 +946,9 @@ def list_assets( if make: conditions.append("make = ?") params.append(make) + if disney_park: + conditions.append("disney_park = ?") + params.append(disney_park) if model: conditions.append("model = ?") params.append(model) diff --git a/static/index.html b/static/index.html index bc5f5bc..01f0927 100644 --- a/static/index.html +++ b/static/index.html @@ -3021,7 +3021,7 @@ // ── Filter state ────────────────────────────────────────────────────── let assetFilters = { category: null, status: null, make: null, disney_park: null, q: '' }; let assetOffset = 0; - const ASSET_PAGE_SIZE = 100; + const ASSET_PAGE_SIZE = 2000; let assetTotal = 0; let assetDebounce = null; let cachedAssets = []; @@ -3060,6 +3060,7 @@ if (assetFilters.category) params.set('category', assetFilters.category); if (assetFilters.status) params.set('status', assetFilters.status); if (assetFilters.make) params.set('make', assetFilters.make); + if (assetFilters.disney_park) params.set('disney_park', assetFilters.disney_park); if (assetFilters.q) params.set('q', assetFilters.q); if (assetFilters.assigned_to) params.set('assigned_to', assetFilters.assigned_to); params.set('limit', String(ASSET_PAGE_SIZE)); @@ -3069,14 +3070,7 @@ var result = await api('/api/assets?' + params.toString(), {_returnMeta: true}); var assets = result.data; assetTotal = parseInt(result.headers.get('X-Total-Count')) || assets.length; - // Client-side filter fallback if server doesn't support assigned_to - var filtered = assetFilters.assigned_to - ? assets.filter(function(a) { return a.assigned_to === assetFilters.assigned_to; }) - : assets; - filtered = assetFilters.disney_park - ? filtered.filter(function(a) { return a.disney_park === assetFilters.disney_park; }) - : filtered; - renderAssetList(filtered); + renderAssetList(assets); renderFilterPills(assets); renderPagination(); } catch (e) {