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

292
Views
how to filter axios response

how to filter axios response? so i need to filter and get filtered response in browser, database is monodb...

const getNodeData = (route, params) => 
  new Promise((resolve, reject) =>
   axios.get(route, {
    params,
    withCredentials: true
    })
    .then((res) => reslove(get(res, 'data.data', [])))
    .catch((error) =< reject(error))
);

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

There are two ways for filtering yor response.

1 - If this filter will occour everytime, then you can need the query in the back end to adjust it.

2 - In the front end, get your response (res) and give a variable that uses a loop for filtering.

Example:

const getNodeData = (route, params) => {
  axios.get(route, {
    params,
    withCredentials: true
  })
    .then((res) => {
      const data = res.filter("YOUR FILTER CONDITION HERE")
      return data;
    })
    .catch((error) => console.log(error))
}
about 4 years ago · Juan Pablo Isaza Report
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!