Skip to content

Commit

Permalink
Merge pull request #75 from datopian/fix/org-search
Browse files Browse the repository at this point in the history
[fix][x] Search on organization page fixed
  • Loading branch information
Mikanebu authored Apr 26, 2023
2 parents 46227af + 493a16a commit 4042c87
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ module.exports = function (app) {
})

app.get('/search', async (req, res, next) => {
req.query.q = req.query.filter ? `${req.query.filter} ${req.query.q}` : req.query.q
delete req.query.filter
try {
let facetNameToShowAll
for (let [key, value] of Object.entries(req.query)) {
Expand Down
1 change: 1 addition & 0 deletions views/partials/data-search-form.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<form id="search-field" role="search" action="/search" method="GET">
<div class="relative mb-5">
<input id="search-input" aria-label="{{__('Search datasets')}}" type="text" class="border-2 border-solid border-gray-200 py-4 pl-4 pr-20 text-xl outline-none focus:border-secondary w-full" placeholder="{{__('Search datasets')}}" name="q" value="" autofocus>
<input id="search-filter" type="text" hidden name="filter" value={{query.q}} >
<button id="search-button" class="absolute inset-y-0 right-0 w-16 px-4 text-secondary fill-current" type="submit" aria-label="Submit">
<svg class="w-full h-full"><use xlink:href="#search" /></svg>
</button>
Expand Down

0 comments on commit 4042c87

Please sign in to comment.