mirror of
https://github.com/jcreek/LivingDexTracker.git
synced 2026-07-13 02:53:45 +00:00
fix(*): Add error handling for no pokedex entries
This commit is contained in:
@@ -32,7 +32,6 @@
|
||||
}
|
||||
|
||||
async function fetchCatchRecords() {
|
||||
console.log('Fetching catch record data');
|
||||
const response = await fetch('/api/catch-records');
|
||||
if (!response.ok) {
|
||||
throw new Error('Failed to fetch catch record data');
|
||||
@@ -53,6 +52,11 @@
|
||||
personalNotes: ''
|
||||
}));
|
||||
|
||||
if (newCatchRecords.length === 0) {
|
||||
alert('No pokedex entries to create catch records for');
|
||||
return;
|
||||
}
|
||||
|
||||
const batchSize = 500;
|
||||
for (let i = 0; i < newCatchRecords.length; i += batchSize) {
|
||||
const batch = newCatchRecords.slice(i, i + batchSize);
|
||||
|
||||
Reference in New Issue
Block a user