I've been assigned a task to do with integrating APIs. I've been able to fetch information from the API, but there's a popup showing up, asking me to submit username and password. I have the username and password, but the idea is to log in without the necessity of that popup showing up.
Here's the code:
const getPlate = () => {
let licensePlate = document.getElementById('licensePlate');
let licensePlateNumber = licensePlate.value;
if (licensePlate.value === "") {
alert('¡Debe introducir el número de matrícula para poder avanzar!');
} else {
Axios.get( * URL GOES HERE * ).then((response) => {
let plate = response;
console.log(plate.data[i].make);
});
}
}
<div id="carDataContainer">
<div id="licensePlateContainer">
<input type="text" name="licensePlate" id="licensePlate" placeholder="Matrícula - ej. 001 BNDO"></input>
<button type="button" id="plateBtn" onClick={ getPlate }>Search</button>
</div>
</div>