add name volume and update error handling
This commit is contained in:
@@ -72,6 +72,6 @@ export async function GET(req: NextRequest) {
|
||||
{ status: 200 }
|
||||
);
|
||||
}
|
||||
return Response.json({ error: 'Failed to fetch cards' }, { status: 500 });
|
||||
return Response.json({ error: `Failed to fetch cards: ${err}` }, { status: 500 });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ export default function Page() {
|
||||
setError(null);
|
||||
try {
|
||||
const res = await fetch('/api/magikarp?pageSize=250&refresh=1', { cache: 'no-store' });
|
||||
if (!res.ok) throw new Error('Failed to refresh');
|
||||
if (!res.ok) throw new Error(`Failed to refresh: ${res.body}`);
|
||||
const json = await res.json();
|
||||
const list: TcgCard[] = json.data || [];
|
||||
list.sort((a, b) => {
|
||||
|
||||
Reference in New Issue
Block a user