({ vehicleType, referenceTable, makerCode })
| 3 | import { FIPE_URL, VEHICLE_TYPE } from './constants'; |
| 4 | |
| 5 | async function listByMaker({ vehicleType, referenceTable, makerCode }) { |
| 6 | const params = new URLSearchParams(); |
| 7 | params.append('codigoTabelaReferencia', referenceTable); |
| 8 | params.append('codigoTipoVeiculo', vehicleType); |
| 9 | params.append('codigoMarca', makerCode); |
| 10 | |
| 11 | const { data } = await axios.post( |
| 12 | `${FIPE_URL}/veiculos/ConsultarModelos`, |
| 13 | params, |
| 14 | { |
| 15 | headers: { |
| 16 | 'Content-Type': 'application/x-www-form-urlencoded', |
| 17 | }, |
| 18 | } |
| 19 | ); |
| 20 | |
| 21 | return data.Modelos.map((item) => ({ modelo: item.Label })); |
| 22 | } |
| 23 | |
| 24 | export async function listCarByMaker(makerCode, referenceTableCode) { |
| 25 | return listByMaker({ |
no outgoing calls
no test coverage detected