deckhearth/pages/api/decks.js

23 lines
759 B
JavaScript
Raw Normal View History

import { sql } from '@vercel/postgres';
export default async function handler(req, res) {
if (req.method !== 'GET') {
return res.status(405).json({ error: 'Method not allowed' });
}
try {
// For now, return mock decks until we implement user authentication
const mockDecks = [
{ id: 1, name: 'MTG Control Deck', game: 'MTG' },
{ id: 2, name: 'Pokemon Aggro', game: 'Pokemon' },
{ id: 3, name: 'Lorcana Midrange', game: 'Lorcana' },
{ id: 4, name: 'MTG Combo', game: 'MTG' },
{ id: 5, name: 'Pokemon Stall', game: 'Pokemon' }
];
res.status(200).json(mockDecks);
} catch (error) {
console.error('Error fetching decks:', error);
res.status(500).json({ error: 'Failed to fetch decks' });
}
}