Skip to content

Commit 746dfc7

Browse files
committed
Fixing it to filter on key, not id
1 parent c3b606f commit 746dfc7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/swagger.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ paths:
184184
- name: events
185185
in: query
186186
description: >-
187-
Filter by multiple event IDs
187+
Filter by multiple event keys (ie: tco21)
188188
required: false
189189
type: array
190190
items:

src/services/ChallengeService.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,11 @@ async function searchChallenges (currentUser, criteria) {
277277
if (criteria.events) {
278278
if (criteria.includeAllEvents) {
279279
for (const e of criteria.events) {
280-
boolQuery.push({ match_phrase: { 'events.id': e } })
280+
boolQuery.push({ match_phrase: { 'events.key': e } })
281281
}
282282
} else {
283283
for (const e of criteria.events) {
284-
shouldQuery.push({ match: { 'events.id': e } })
284+
shouldQuery.push({ match: { 'events.key': e } })
285285
}
286286
}
287287
}

0 commit comments

Comments
 (0)