I'm using to Papaparse to convert a csv file to json object.
The API expects the data in this way:
"data": [
{
"id": 1,
"nombre": "AGUASBLANCAS-AGB",
"descripcion": "-",
"it_unidad_generadora": 0
},
{
"id": 425,
"nombre": "AGUASBLANCAS-AGBQ",
"descripcion": "-",
"it_unidad_generadora": 403
}
]
But with Papaparse, the csv is converted to an array of arrays of each row like this:
"data": [
0: ["ID", "NOMBRE", "DESCRIPCIÓN", "IT UNIDAD GENERADORA"]
1: ["1", "AGUASBLANCAS-AGB", "-", "0"]
2: ["425", "AGUASBLANCAS-AGBQ", "-", "403"]
]
Is there a way to make an JSON array of object with Papaparse? and not an array of arrays of each rows