Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!