()
| 3 | import { FIPE_URL } from './constants'; |
| 4 | |
| 5 | export async function listReferenceTables() { |
| 6 | const { data } = await axios.post( |
| 7 | `${FIPE_URL}/veiculos/ConsultarTabelaDeReferencia`, |
| 8 | {}, |
| 9 | { |
| 10 | headers: { |
| 11 | 'Content-Type': 'application/x-www-form-urlencoded', |
| 12 | }, |
| 13 | } |
| 14 | ); |
| 15 | |
| 16 | return data |
| 17 | .map((item) => ({ codigo: item.Codigo, mes: item.Mes })) |
| 18 | .sort((a, b) => b.codigo - a.codigo); |
| 19 | } |
| 20 | |
| 21 | export async function getLatestReferenceTable() { |
| 22 | const tables = await listReferenceTables(); |
no outgoing calls
no test coverage detected