Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

159
Vistas
use an axios returned data in pug

What I am trying to do here, is to make an object that was returned from axios (front-end) known in the pug template so I can use it in multiple places. But I don't want to create the markeup and inject the data (because it will take me long) is this dowable? thank you in advance

The axios function below returns the carSearch, which is an object, and it is the same object I want to use in the pug template for example make it as global object inside the pug template.

const btnSearchBodyType = document.querySelectorAll('.car-type');
let carBody = {};
btnSearchBodyType.forEach((el) =>
    el.addEventListener('click', async function() {
        carBody['body style'] = el.className.split(' ')[1];
        console.log(carBody);
        const carSearch = await searchBodyType(
            carBody, ['body style'],
            el.className.split(' ')[1]
        );
        console.log(carSearch);
    })
);

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda