mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-29 01:55:01 +00:00
address selection: filter cities based on country
This commit is contained in:
@@ -16,13 +16,12 @@ const fetchCountries = () => {
|
||||
|
||||
/*
|
||||
* Endpoint cities GET
|
||||
* TODO
|
||||
* method GET, get Country Object
|
||||
* @returns {Promise} a promise containing all Postal Code objects filtered with country
|
||||
*/
|
||||
const fetchCities = (country) => {
|
||||
console.log('<<< fetching cities for', country);
|
||||
//TODO use country
|
||||
//TODO deal with huge number of postal code ... we should do suggestion...
|
||||
const url = `/api/1.0/main/postal-code.json`;
|
||||
const url = `/api/1.0/main/postal-code.json?item_per_page=1000&country=${country.id}`;
|
||||
return fetch(url)
|
||||
.then(response => {
|
||||
if (response.ok) { return response.json(); }
|
||||
@@ -37,7 +36,7 @@ const fetchCities = (country) => {
|
||||
*/
|
||||
const fetchReferenceAddresses = (city) => {
|
||||
console.log('<<< fetching references addresses for', city); // city n'est pas utilisé pour le moment
|
||||
|
||||
//TODO deal with huge number of addresses... we should do suggestion...
|
||||
const url = `/api/1.0/main/address-reference.json`;
|
||||
return fetch(url)
|
||||
.then(response => {
|
||||
|
Reference in New Issue
Block a user