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
@@ -22,16 +22,19 @@ class CombinedDataRepository {
},
{
$sort: {
'boxPlacement.box': 1,
'boxPlacement.row': 1,
'boxPlacement.column': 1
'boxPlacementForms.box': 1,
'boxPlacementForms.row': 1,
'boxPlacementForms.column': 1
}
},
{ $skip: skip },
{ $limit: limit }
]).exec();
return combinedData.map((data) => ({
// Filter out entries with no catch records
const filteredData = combinedData.filter((data) => data.catchRecord);
return filteredData.map((data) => ({
pokedexEntry: data as PokedexEntry,
catchRecord: data.catchRecord as CatchRecord
}));