Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

160
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda