VIN Numbers can be decoded.

This commit is contained in:
Roland 2023-06-11 12:31:56 -06:00
parent e5fe1b6bb9
commit f2a4eb930c
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
8 changed files with 195 additions and 4 deletions

View file

@ -825,3 +825,15 @@ export async function uploadFiles(files, destination) {
data.append('destination', destination);
console.log(data);
}
export async function fetchDecoded(vinNumber) {
const body = {vin_number: vinNumber};
const response = await apiPost(`${API_URI}/vin_number_decoder`, body);
if (response.status === 200) {
const content = await response.json();
return content['vin'];
} else if (response.status === 400) {
console.error('Invalid VIN Number');
return null;
}
}