feat(*): Change how data is set up

This commit is contained in:
Josh Creek
2026-01-16 21:11:21 +00:00
parent 3f0003b006
commit ee73c01afe
22 changed files with 8253 additions and 1159 deletions
@@ -31,7 +31,8 @@ class CombinedDataRepository {
return {
_id: record.id,
userId: record.userId,
pokedexEntryId: record.pokedexEntryId.toString(),
// Backwards-compatible field name; DB column is pokemonId
pokedexEntryId: record.pokemonId.toString(),
pokedexId: record.pokedexId,
haveToEvolve: record.haveToEvolve,
caught: record.caught,
@@ -87,7 +88,7 @@ class CombinedDataRepository {
.select('*')
.eq('userId', userId)
.eq('pokedexId', this.pokedexId)
.in('pokedexEntryId', entryIds);
.in('pokemonId', entryIds);
if (!recordsError && records) {
catchRecords = records;
@@ -96,8 +97,7 @@ class CombinedDataRepository {
// Combine the data exactly like master branch
const combinedData = entries.map((entry) => {
const userCatchRecord =
catchRecords.find((record) => record.pokedexEntryId === entry.id) || null;
const userCatchRecord = catchRecords.find((record) => record.pokemonId === entry.id) || null;
const transformedEntry = this.transformPokedexEntry(entry);
const transformedCatchRecord = userCatchRecord
@@ -165,7 +165,7 @@ class CombinedDataRepository {
.select('*')
.eq('userId', userId)
.eq('pokedexId', this.pokedexId)
.in('pokedexEntryId', entryIds);
.in('pokemonId', entryIds);
if (!recordsError && records) {
catchRecords = records;
@@ -174,8 +174,7 @@ class CombinedDataRepository {
// Combine the data exactly like master branch
const combinedData = entries.map((entry) => {
const userCatchRecord =
catchRecords.find((record) => record.pokedexEntryId === entry.id) || null;
const userCatchRecord = catchRecords.find((record) => record.pokemonId === entry.id) || null;
const transformedEntry = this.transformPokedexEntry(entry);
const transformedCatchRecord = userCatchRecord