search
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 2m15s

This commit is contained in:
Arnaud Delcasse
2026-03-27 14:50:41 +01:00
parent c3231632ac
commit 2837630e53
7 changed files with 65 additions and 30 deletions

View File

@@ -36,7 +36,7 @@
@focus="departure.showResults = departure.results.length > 0"
@click.outside="departure.showResults = false"
autocomplete="off"
placeholder=""
placeholder="{{ site.Params.search.placeholderDepart }}"
:class="{ 'input-error': errors.departure }"
required />
<ul class="autocomplete-results" x-show="departure.showResults && departure.results.length > 0" x-cloak>
@@ -62,7 +62,7 @@
@focus="destination.showResults = destination.results.length > 0"
@click.outside="destination.showResults = false"
autocomplete="off"
placeholder=""
placeholder="{{ site.Params.search.placeholderDestination }}"
:class="{ 'input-error': errors.destination }"
required />
<ul class="autocomplete-results" x-show="destination.showResults && destination.results.length > 0" x-cloak>
@@ -179,7 +179,7 @@
}
try {
const response = await fetch(`https://api-adresse.data.gouv.fr/search/?q=${encodeURIComponent(fieldData.input)}&limit=5`);
const response = await fetch(`https://data.geopf.fr/geocodage/search/?q=${encodeURIComponent(fieldData.input)}&limit=5`);
const json = await response.json();
fieldData.results = json.features || [];
fieldData.showResults = fieldData.results.length > 0;