diff --git a/src/lib/repositories/CatchRecordRepository.ts b/src/lib/repositories/CatchRecordRepository.ts index b9ddcf7..c3c22c9 100644 --- a/src/lib/repositories/CatchRecordRepository.ts +++ b/src/lib/repositories/CatchRecordRepository.ts @@ -140,11 +140,15 @@ class CatchRecordRepository { } async findByUserAndPokemon(userId: string, pokedexEntryId: string): Promise { + const numericId = Number(pokedexEntryId); + if (isNaN(numericId)) { + return null; + } const { data, error } = await this.supabase .from('catch_records') .select('*') .eq('userId', userId) - .eq('pokedexEntryId', pokedexEntryId) + .eq('pokedexEntryId', numericId) .single(); if (error || !data) return null;