From e41d0b986e0e876c1d984588e27253830a0542b2 Mon Sep 17 00:00:00 2001 From: Randall Stillwell Date: Fri, 25 Jul 2025 23:13:54 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Fixed=20TCG=20Tags=20and=20Add?= =?UTF-8?q?=20Cards=20Button?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added missing 'game' field to collection cards API query - Added onClick handler to 'Add Cards' button (redirects to /cards) - Enhanced debug logging to see actual card data - Ran sample cards script to ensure cards exist in database This should fix the missing TCG tags issue by including the game field in the API response. --- components/CollaboratorFacepile.js | 4 +++- pages/api/collections/[id].js | 1 + pages/collection/[id].js | 6 +++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/components/CollaboratorFacepile.js b/components/CollaboratorFacepile.js index 9291f3a..a6e859a 100644 --- a/components/CollaboratorFacepile.js +++ b/components/CollaboratorFacepile.js @@ -78,7 +78,9 @@ export default function CollaboratorFacepile({ collectionId, creatorEmail }) { creatorEmail, collaborators: collaborators.length, allUsers: allUsers.length, - loading + loading, + collaboratorsData: collaborators, + allUsersData: allUsers }); return ( diff --git a/pages/api/collections/[id].js b/pages/api/collections/[id].js index f4e7397..194d71e 100644 --- a/pages/api/collections/[id].js +++ b/pages/api/collections/[id].js @@ -41,6 +41,7 @@ async function handler(req, res) { cards.set_name, cards.rarity, cards.card_type, + cards.game, cards.image_url, cards.market_price FROM collection_cards cc diff --git a/pages/collection/[id].js b/pages/collection/[id].js index 8b1a3e7..d8b8107 100644 --- a/pages/collection/[id].js +++ b/pages/collection/[id].js @@ -302,6 +302,7 @@ export default function CollectionView() { // Debug: Log the grouped cards to see what games we have console.log('Grouped cards:', groupedCards); console.log('Available games:', Object.keys(groupedCards)); + console.log('Sample card data:', cards[0]); // Check what fields the card actually has // Get game display names and counts - make it more flexible const gameStats = {}; @@ -561,7 +562,10 @@ export default function CollectionView() { -