Skip to content

Commit

Permalink
fix(search): limit as string
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarbeau committed May 5, 2017
1 parent f88d85f commit 2f7a896
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/lib/search/search-sources/icherche-search-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ export class IChercheSearchSource extends SearchSource {
}

private getSearchParams (term: string): URLSearchParams {
const limit = this.options.limit === undefined5 : this.options.limit;
const search = new URLSearchParams();
const limit = this.options.limit === undefined ? 5 : this.options.limit;

search.set('q', term);
search.set('limit', limit);
search.set('limit', String(limit));
search.set('callback', 'JSONP_CALLBACK');
search.set('geometries', 'geom');

Expand Down
2 changes: 1 addition & 1 deletion src/lib/search/search-sources/nominatim-search-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class NominatimSearchSource extends SearchSource {

private getSearchParams (term: string): URLSearchParams {
const search = new URLSearchParams();
const limit = this.options.limit === undefined ? 5 : this.options.limit;
const limit = this.options.limit === undefined ? 5 : this.options.limit;

search.set('q', term);
search.set('format', 'json');
Expand Down

0 comments on commit 2f7a896

Please sign in to comment.