Skip to content

Commit

Permalink
fix: search raid before hatching
Browse files Browse the repository at this point in the history
  • Loading branch information
Mygod committed Dec 10, 2024
1 parent 03df84e commit 060d4ac
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions server/src/models/Gym.js
Original file line number Diff line number Diff line change
Expand Up @@ -535,11 +535,7 @@ class Gym extends Model {
.whereIn(isMad ? 'pokemon_id' : 'raid_pokemon_id', pokemonIds)
.limit(config.getSafe('api.searchResultsLimit'))
.orderBy('distance')
.andWhere(
isMad ? 'start' : 'raid_battle_timestamp',
'<=',
isMad ? this.knex().fn.now() : ts,
)
.andWhere('raid_pokemon_id', '>', 0)
.andWhere(
isMad ? 'end' : 'raid_end_timestamp',
'>=',
Expand Down

0 comments on commit 060d4ac

Please sign in to comment.