Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
Only allow defined query
Browse files Browse the repository at this point in the history
  • Loading branch information
mustofa-id committed Jul 7, 2019
1 parent 2c47ce0 commit d8e5b06
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/shared/post-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ export function filter (items, location) {
// Get first key in search params. eg from sample above `tag`
const type = params.keys().next().value

// Only allow query from queryType
for (let key in queryType) {
if (type !== queryType[key]) {
return items
}
}

// Get value of search params given type. eg from sample above `palette`
const query = params.get(type)

Expand Down

0 comments on commit d8e5b06

Please sign in to comment.