Skip to content

Commit 877c7eb

Browse files
committed
Revert "fix: search"
This reverts commit 26eaaab.
1 parent aba5abb commit 877c7eb

File tree

7 files changed

+12
-18
lines changed

7 files changed

+12
-18
lines changed

packages/types/lib/server.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export interface DbContext {
3434
hasRewardAmount: boolean
3535
hasPowerUp: boolean
3636
hasAltQuests: boolean
37+
hasLayerColumn: boolean
3738
hasMultiInvasions: boolean
3839
multiInvasionMs: boolean
3940
hasConfirmed: boolean

server/src/models/Gym.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,7 @@ class Gym extends Model {
384384
}
385385
}
386386

387-
// eslint-disable-next-line no-empty-pattern
388-
static async search(perms, args, {}, distance, bbox) {
387+
static async search(perms, args, distance, bbox) {
389388
const { areaRestrictions } = perms
390389
const { onlyAreas = [], search = '' } = args
391390

server/src/models/Nest.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ class Nest extends Model {
164164
* @param {ReturnType<typeof import("server/src/utils/getBbox").getBboxFromCenter>} bbox
165165
* @returns {Promise<FullNest[]>}
166166
*/
167-
// eslint-disable-next-line no-empty-pattern
168-
static async search(perms, args, {}, distance, bbox) {
167+
static async search(perms, args, distance, bbox) {
169168
const { search, locale, onlyAreas = [] } = args
170169
const pokemonIds = Object.keys(state.event.masterfile.pokemon).filter(
171170
(pkmn) =>

server/src/models/Pokestop.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ class Pokestop extends Model {
103103
} = args
104104
const midnight = getUserMidnight(args)
105105
const ts = Math.floor(Date.now() / 1000)
106-
const { queryLimits, stopValidDataLimit, hideOldPokestops } =
107-
config.getSafe('api')
106+
const { queryLimits, stopValidDataLimit } = config.getSafe('api')
108107

109108
const {
110109
lures: lurePerms,
@@ -116,9 +115,7 @@ class Pokestop extends Model {
116115
} = perms
117116

118117
const query = this.query()
119-
if (hideOldPokestops) {
120-
query.where('pokestop.updated', '>', ts - stopValidDataLimit * 86400)
121-
}
118+
query.where('pokestop.updated', '>', ts - stopValidDataLimit * 86400)
122119

123120
Pokestop.joinIncident(query, hasMultiInvasions, multiInvasionMs)
124121
query
@@ -1320,8 +1317,7 @@ class Pokestop extends Model {
13201317
return quest
13211318
}
13221319

1323-
// eslint-disable-next-line no-empty-pattern
1324-
static async search(perms, args, {}, distance, bbox) {
1320+
static async search(perms, args, distance, bbox) {
13251321
const { onlyAreas = [], search = '' } = args
13261322
const query = this.query()
13271323
.select(['name', 'id', 'lat', 'lon', 'url', distance])
@@ -1478,8 +1474,7 @@ class Pokestop extends Model {
14781474
return mapped.map((result) => this.parseRdmRewards(result)).filter(Boolean)
14791475
}
14801476

1481-
// eslint-disable-next-line no-empty-pattern
1482-
static async searchLures(perms, args, {}, distance, bbox) {
1477+
static async searchLures(perms, args, distance, bbox) {
14831478
const { search, onlyAreas = [], locale } = args
14841479
const ts = Math.floor(Date.now() / 1000)
14851480

@@ -1635,7 +1630,7 @@ class Pokestop extends Model {
16351630
* @returns {Promise<{ hasConfirmedInvasions: boolean }>}
16361631
*/
16371632
static async getFilterContext({ hasConfirmed }) {
1638-
if (!hasConfirmed) return { hasConfirmedInvasions: false }
1633+
if (false || !hasConfirmed) return { hasConfirmedInvasions: false }
16391634
const result = await this.query()
16401635
.from('incident')
16411636
.count('id', { as: 'total' })

server/src/models/Portal.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ class Portal extends Model {
5151
* @param {ReturnType<typeof import("server/src/utils/getBbox").getBboxFromCenter>} bbox
5252
* @returns {Promise<import("@rm/types").FullPortal[]>}
5353
*/
54-
// eslint-disable-next-line no-empty-pattern
55-
static async search(perms, args, {}, distance, bbox) {
54+
static async search(perms, args, distance, bbox) {
5655
const { areaRestrictions } = perms
5756
const { onlyAreas = [], search = '' } = args
5857
const { searchResultsLimit, portalUpdateLimit } = config.getSafe('api')

server/src/models/Station.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,7 @@ class Station extends Model {
230230
* @param {ReturnType<typeof import("server/src/utils/getBbox").getBboxFromCenter>} bbox
231231
* @returns {Promise<import("@rm/types").FullStation[]>}
232232
*/
233-
// eslint-disable-next-line no-empty-pattern
234-
static async search(perms, args, {}, distance, bbox) {
233+
static async search(perms, args, distance, bbox) {
235234
const { areaRestrictions } = perms
236235
const { onlyAreas = [], search = '', locale } = args
237236
const { searchResultsLimit, stationUpdateLimit } = config.getSafe('api')

server/src/services/DbManager.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ class DbManager extends Logger {
150150
])
151151
const hasStationedGmax =
152152
'total_stationed_gmax' in (await schema('station').columnInfo())
153+
const [hasLayerColumn] = [false]
153154
const [hasMultiInvasions, multiInvasionMs, hasConfirmed] = await schema(
154155
'incident',
155156
)
@@ -179,6 +180,7 @@ class DbManager extends Logger {
179180
hasRewardAmount,
180181
hasPowerUp,
181182
hasAltQuests,
183+
hasLayerColumn,
182184
hasMultiInvasions,
183185
multiInvasionMs,
184186
hasConfirmed,

0 commit comments

Comments
 (0)