Skip to content

Commit

Permalink
fix(geo): garantine no comma in the beginning and end of search term (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
aziz-access authored Feb 14, 2024
1 parent f4959eb commit d5e20f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/geo/src/lib/search/shared/sources/cadastre.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ export class CadastreSearchSource extends SearchSource implements TextSearch {
term: string | undefined,
options?: TextSearchOptions
): Observable<SearchResult<Feature>[]> {
term = term.replace(/ /g, '');
term = term.replace(/,+/g, ',');
term = term.endsWith(',') ? term.slice(0, -1) : term;
term = term.startsWith(',') ? term.substr(1) : term;
term = term.replace(/ /g, '');

const params = this.computeSearchRequestParams(term, options || {});
if (!params.get('numero') || !params.get('numero').match(/^[0-9,]+$/g)) {
Expand Down

0 comments on commit d5e20f8

Please sign in to comment.