From ebb529578207e1d6a11f40a99e942030ec95c3e0 Mon Sep 17 00:00:00 2001 From: lenisko <10072920+lenisko@users.noreply.github.com> Date: Sat, 10 Feb 2024 19:54:20 +0100 Subject: [PATCH 1/2] fix(nest): query only active nests --- server/src/models/Nest.js | 1 + 1 file changed, 1 insertion(+) diff --git a/server/src/models/Nest.js b/server/src/models/Nest.js index 24a03d983..3f4b34cec 100644 --- a/server/src/models/Nest.js +++ b/server/src/models/Nest.js @@ -116,6 +116,7 @@ class Nest extends Model { const results = /** @type {FullNest[]} */ ( await this.query() .select(['pokemon_id', 'pokemon_form']) + .andWhere('active', 1) .whereNotNull('pokemon_id') .groupBy('pokemon_id', 'pokemon_form') .orderBy('pokemon_id', 'asc') From 9d97481039356de2c1e6165abbb207a7d7af6cce Mon Sep 17 00:00:00 2001 From: lenisko <10072920+lenisko@users.noreply.github.com> Date: Sat, 10 Feb 2024 20:01:32 +0100 Subject: [PATCH 2/2] fix(nest): make it compatible with previous tools --- server/src/models/Nest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/models/Nest.js b/server/src/models/Nest.js index 3f4b34cec..82d000273 100644 --- a/server/src/models/Nest.js +++ b/server/src/models/Nest.js @@ -116,7 +116,7 @@ class Nest extends Model { const results = /** @type {FullNest[]} */ ( await this.query() .select(['pokemon_id', 'pokemon_form']) - .andWhere('active', 1) + .where('pokemon_id', '!=', 0) .whereNotNull('pokemon_id') .groupBy('pokemon_id', 'pokemon_form') .orderBy('pokemon_id', 'asc')