mirror of
https://github.com/jcreek/LivingDexTracker.git
synced 2026-07-13 02:53:45 +00:00
feat(*): Update pokedex entry data structure and re-add error handling
This commit is contained in:
@@ -10,6 +10,10 @@ export const GET = async ({ url }) => {
|
||||
await dbConnect();
|
||||
const repo = new CombinedDataRepository();
|
||||
const combinedData = await repo.findCombinedData(page, limit);
|
||||
|
||||
if (combinedData.length === 0) {
|
||||
return json({ error: 'No combined data found' }, { status: 404 });
|
||||
}
|
||||
const totalCount = await repo.countCombinedData();
|
||||
const totalPages = Math.ceil(totalCount / limit);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user