add store postAddress fetch request

This commit is contained in:
2021-05-12 09:50:43 +02:00
parent 2aed37757e
commit cb846891d6
4 changed files with 60 additions and 30 deletions

View File

@@ -1,5 +1,6 @@
/*
* Endpoint countries GET
* TODO
*/
const fetchCountries = () => {
console.log('<<< fetching countries');
@@ -10,9 +11,10 @@ const fetchCountries = () => {
};
/*
* Endpoint cities GET
* Endpoint cities GET
* TODO
*/
const fetchCities = (country) => {
const fetchCities = (country) => {
console.log('<<< fetching cities for', country);
return [
{id: 1, name: 'Bruxelles', code: '1000', country: 'BE'},
@@ -27,7 +29,8 @@ const fetchCities = (country) => {
* @returns {Promise} a promise containing all AddressReference object
*/
const fetchReferenceAddresses = (city) => {
console.log('<<< fetching references addresses for', city);
console.log('<<< fetching references addresses for', city); // city n'est pas utilisé pour le moment
const url = `/api/1.0/main/address-reference.json`;
return fetch(url)
.then(response => {