🔧 Fixed TCG Tags and Add Cards Button

- 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.
This commit is contained in:
Randall Stillwell 2025-07-25 23:13:54 -05:00
parent 7090adbb28
commit e41d0b986e
3 changed files with 9 additions and 2 deletions

View file

@ -78,7 +78,9 @@ export default function CollaboratorFacepile({ collectionId, creatorEmail }) {
creatorEmail,
collaborators: collaborators.length,
allUsers: allUsers.length,
loading
loading,
collaboratorsData: collaborators,
allUsersData: allUsers
});
return (

View file

@ -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

View file

@ -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() {
</button>
</div>
<button className="px-4 py-2 bg-purple-600 text-white rounded-lg hover:bg-purple-700 flex items-center space-x-2">
<button
onClick={() => router.push('/cards')}
className="px-4 py-2 bg-purple-600 text-white rounded-lg hover:bg-purple-700 flex items-center space-x-2"
>
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 6v6m0 0v6m0-6h6m-6 0H6" />
</svg>