feat(*): Update pokedex entry data structure and re-add error handling

This commit is contained in:
Josh Creek
2024-07-14 16:16:18 +01:00
parent 90f6bd6e75
commit 7467a4425f
9 changed files with 21000 additions and 4187 deletions
+4
View File
@@ -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);