Open johanavasq opened 5 years ago
How could I do that when I click and select a card with another api I automatically load the name, surname, telephone data.
<Autocomplete key={shortid.generate()} style={baseStyles.input} scrollToInput={ev => { }} handleSelectItem={(item, index) => {}} onDropdownClose={() => { }} onDropdownShow={() => { }} minimumCharactersCount={1} highlightText valueExtractor={item => item.cedula) } rightContent rightTextExtractor={item => item.properties} placeholder="cedula" fetchData={async (cedula) => { const response = await fetch(`https://www.basedx.com/api/buscarcedula? ced=${cedula}`); return await response.json(); } />
how can I pass the other api so that by selecting I fill in the fields. api
fetchData={async (cedula) => { const response = await fetch(`https://www.basedx.com/api/usercedula? user=${cedula}`); var dataCed = await response.json(); return dataCed.map(x => { (item.first_name || item.las_tname || item.telefono) });
example the api returns me
{ user: { first_name: "carmen", last_name: "montoya", telefono: 0 }, success: true
How could I do that when I click and select a card with another api I automatically load the name, surname, telephone data.
how can I pass the other api so that by selecting I fill in the fields. api
example the api returns me