🔧 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:
parent
7090adbb28
commit
e41d0b986e
3 changed files with 9 additions and 2 deletions
|
|
@ -78,7 +78,9 @@ export default function CollaboratorFacepile({ collectionId, creatorEmail }) {
|
||||||
creatorEmail,
|
creatorEmail,
|
||||||
collaborators: collaborators.length,
|
collaborators: collaborators.length,
|
||||||
allUsers: allUsers.length,
|
allUsers: allUsers.length,
|
||||||
loading
|
loading,
|
||||||
|
collaboratorsData: collaborators,
|
||||||
|
allUsersData: allUsers
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ async function handler(req, res) {
|
||||||
cards.set_name,
|
cards.set_name,
|
||||||
cards.rarity,
|
cards.rarity,
|
||||||
cards.card_type,
|
cards.card_type,
|
||||||
|
cards.game,
|
||||||
cards.image_url,
|
cards.image_url,
|
||||||
cards.market_price
|
cards.market_price
|
||||||
FROM collection_cards cc
|
FROM collection_cards cc
|
||||||
|
|
|
||||||
|
|
@ -302,6 +302,7 @@ export default function CollectionView() {
|
||||||
// Debug: Log the grouped cards to see what games we have
|
// Debug: Log the grouped cards to see what games we have
|
||||||
console.log('Grouped cards:', groupedCards);
|
console.log('Grouped cards:', groupedCards);
|
||||||
console.log('Available games:', Object.keys(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
|
// Get game display names and counts - make it more flexible
|
||||||
const gameStats = {};
|
const gameStats = {};
|
||||||
|
|
@ -561,7 +562,10 @@ export default function CollectionView() {
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</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">
|
<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" />
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 6v6m0 0v6m0-6h6m-6 0H6" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue