adding addPersons component with modal, search field and basic suggestions

This commit is contained in:
2021-04-30 17:10:12 +02:00
parent 35e6d36ce0
commit 3d45b6687f
10 changed files with 163 additions and 22 deletions

View File

@@ -0,0 +1,15 @@
const
locale = 'fr',
format = 'json'
;
let searchPersons = (query) => {
let url = `/${locale}/search.${format}?name=person_regular&q=${query}`;
return fetch(url)
.then(response => {
if (response.ok) { return response.json(); }
throw Error('Error with request resource response');
});
};
export { searchPersons };