I have this json response from a api:
[
{
"obj_Id": 66,
"obj_Nombre": "mnu_mantenimiento_de_unidades",
"obj_Descripcion": "Menu de acceso a Mantenimiento de Unidades"
},
{
"obj_Id": 67,
"obj_Nombre": "mnu_vehiculos_en_reparacion",
"obj_Descripcion": "Menu de acceso a Reparacion de Unidades"
},
{
"obj_Id": 68,
"obj_Nombre": "mnu_RTO",
"obj_Descripcion": "Menu de acceso a RTO"
}
]
I have this function to make the request and convert the response:
async obtenerPermisos() {
var respuesta = "";
var obj = {
idUsuario: JSON.parse(sessionStorage.getItem("Codigo")),
contraseña: this.passwordEncriptado,
};
this.url = this.urlBase + "usuario/obtenerPermisos";
respuesta = await this.$http.post(this.url, obj).then((response) => {
const respuesta1 = JSON.parse(respuesta);
sessionStorage.setItem("Permisos", respuesta1);
response.data;
});
console.log("Los permisos del usuario son: ");
console.log(respuesta);
console.log("El tipo de parametro es: " + typeof respuesta);
sessionStorage.setItem("Permisos", respuesta);
this.$router.push({ name: "sideBar" });
location.reload();
},
but i get this error:
how can i resolve it?

response.data;doing? Are you sure you don't need to return it?JSON.parse(respuesta)beJSON.parse(response)?