Update src/lib/repositories/CatchRecordRepository.ts

This commit is contained in:
Josh Creek
2025-07-26 22:22:03 +01:00
committed by GitHub
parent dd31a8d040
commit 120f936eb7
@@ -140,11 +140,15 @@ class CatchRecordRepository {
}
async findByUserAndPokemon(userId: string, pokedexEntryId: string): Promise<CatchRecord | null> {
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;