deckhearth/pages/api/cards
Randall Stillwell 4a0580eacd 🔧 Fix Cards Page Search, Filters, and Infinite Scroll
🔍 Search & Filter Fixes:
- Completely rewrote /api/cards/search.js to support all frontend filters
- Added support for query, game, rarity, set, and price range filters
- Implemented proper pagination with page/limit/offset handling
- Added individual filter combinations for optimal performance

📡 API Enhancements:
- Support for complex filter combinations with JavaScript fallback
- Proper total count calculation for pagination
- Enhanced card data selection including all necessary fields
- Better error handling and response structure

🔄 Infinite Scroll Support:
- Fixed pagination metadata (page, total, pages, hasMore)
- Proper LIMIT/OFFSET implementation for database queries
- Support for incremental loading with page-based navigation

🎯 Filter Combinations Supported:
- No filters (all cards)
- Search by name only
- Filter by game only
- Filter by rarity only
- Game + rarity combination
- Search + game combination
- Complex multi-filter combinations

 Expected Behavior:
- Search bar should now filter cards by name
- TCG filter buttons should work (MTG, Pokemon, Lorcana)
- Rarity, Set, and Price range dropdowns should filter results
- Infinite scroll should load more cards as you scroll down
- Proper card count and pagination information displayed

The cards page should now be fully functional with working search, filters, and infinite scroll! 🃏
2025-07-26 10:06:48 -05:00
..
[id] 🔐 Fix Card Detail Page Authentication Issues 2025-07-26 00:32:58 -05:00
[id].js Created comprehensive admin card editor 2025-07-24 15:16:57 -05:00
import-lorcana.js Add real Lorcana import using Lorcast API 2025-07-24 12:27:10 -05:00
import-mtg.js Major redesign: Enhanced card display with particle effects, improved filters, and search functionality 2025-07-23 21:26:54 -05:00
import-pokemon.js Fix import issues: Add retry logic and better error handling 2025-07-24 10:30:21 -05:00
search.js 🔧 Fix Cards Page Search, Filters, and Infinite Scroll 2025-07-26 10:06:48 -05:00