Skip to content

Commit

Permalink
Fix filter logic
Browse files Browse the repository at this point in the history
The goal here was to filter by all conditions with logic and.
Before this fix the only the logic of the last filter is used.
  • Loading branch information
jNullj committed Mar 5, 2024
1 parent 75f8ac7 commit b54f1e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services/snapcraft/snapcraft-version.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ export default class SnapcraftVersion extends BaseJsonService {
if (filteredChannelMap.length === 0) {
throw new NotFound({ prettyMessage: 'arch not found' })
}
filteredChannelMap = channelMap.filter(
filteredChannelMap = filteredChannelMap.filter(
({ channel }) => channel.track === track,
)
if (filteredChannelMap.length === 0) {
throw new NotFound({ prettyMessage: 'track not found' })
}
filteredChannelMap = channelMap.filter(
filteredChannelMap = filteredChannelMap.filter(
({ channel }) => channel.risk === risk,
)
if (filteredChannelMap.length === 0) {
Expand Down

0 comments on commit b54f1e6

Please sign in to comment.