add name volume and update error handling

This commit is contained in:
2025-08-17 15:52:52 +01:00
parent 65f478e675
commit 7aac334b55
4 changed files with 8 additions and 7 deletions

View File

@@ -1,5 +1,3 @@
{ {
"reverseHolofoil": { "reverseHolofoil": {}
"dp7-65": true
}
} }

View File

@@ -20,6 +20,9 @@ services:
# Select host port via APP_PORT env var; default 3000 # Select host port via APP_PORT env var; default 3000
- "${APP_PORT:-3000}:3000" - "${APP_PORT:-3000}:3000"
volumes: volumes:
# Persist local cache JSON files # Persist cache JSON files using a named volume
- ./data:/app/data - magikarp-data:/app/data
restart: unless-stopped restart: unless-stopped
volumes:
magikarp-data:

View File

@@ -72,6 +72,6 @@ export async function GET(req: NextRequest) {
{ status: 200 } { status: 200 }
); );
} }
return Response.json({ error: 'Failed to fetch cards' }, { status: 500 }); return Response.json({ error: `Failed to fetch cards: ${err}` }, { status: 500 });
} }
} }

View File

@@ -96,7 +96,7 @@ export default function Page() {
setError(null); setError(null);
try { try {
const res = await fetch('/api/magikarp?pageSize=250&refresh=1', { cache: 'no-store' }); 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 json = await res.json();
const list: TcgCard[] = json.data || []; const list: TcgCard[] = json.data || [];
list.sort((a, b) => { list.sort((a, b) => {