add name volume and update error handling
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
{
|
{
|
||||||
"reverseHolofoil": {
|
"reverseHolofoil": {}
|
||||||
"dp7-65": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -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:
|
||||||
|
|||||||
@@ -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 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user