Inclui uso da API de marcas e modelos de carros

This commit is contained in:
Matheus Albino Brunhara
2022-08-29 02:06:36 -03:00
parent de0cf3b6f8
commit fa3fac82fb
5 changed files with 155 additions and 41 deletions

View File

@@ -16,10 +16,19 @@ function updateHeader() {
"Authorization": 'Bearer ' + token
}
}
export async function list() {
export async function listAllBrands() {
updateHeader();
const response = await instance.get(carsRoutes.list.url, { headers: header });
const response = await instance.get(carsRoutes.listAllBrands.url, { headers: header });
return response.data;
}
export async function listCarModels(carBrandId: string) {
updateHeader();
const response = await instance.get(carsRoutes.listCarModels.url + `/${carBrandId}`, { headers: header });
return response.data;
}