Skip to content

Commit 77ae1b8

Browse files
committed
Add an all_keywords parameter to the search route
Pass along any specified value for the all_keywords parameter to the API request to search crates. This lets us manually construct URLs in the browser like: - /search?all_keywords=foo+bar - /search?all_keywords=foo+bar&q=test but there is no form field in the search form as yet; eventually, we'll need an "advanced search" form or similar.
1 parent 742369c commit 77ae1b8

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

app/controllers/application.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export default Controller.extend(EKMixin, {
2828
queryParams: {
2929
q: this.searchQuery,
3030
page: 1,
31+
all_keywords: null,
3132
},
3233
});
3334
},

app/controllers/search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import PaginationMixin from '../mixins/pagination';
99

1010
export default Controller.extend(PaginationMixin, {
1111
search: service(),
12-
queryParams: ['q', 'page', 'per_page', 'sort'],
12+
queryParams: ['all_keywords', 'page', 'per_page', 'q', 'sort'],
1313
q: alias('search.q'),
1414
page: '1',
1515
per_page: 10,

app/routes/search.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import Route from '@ember/routing/route';
22

33
export default Route.extend({
44
queryParams: {
5-
q: { refreshModel: true },
5+
all_keywords: { refreshModel: true },
66
page: { refreshModel: true },
7+
q: { refreshModel: true },
78
sort: { refreshModel: true },
89
},
910

0 commit comments

Comments
 (0)