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

84
Views
How to push response data redux saga

so the idea is everytime i click the button it will dispatch my action,and i want to push my response data into an array, but it always overwrite an exising array, how do i fix it?

this is my code

function searchApiPhoto(param, page) {
  const config = {
    headers: {
      Authorization: 'api-token',
    },
  }
  return axios
    .get(apiurl, config)
    .then((res) => {
      let data = []
      // let result = [];
      // console.log("data :", res.data.results);
      // data = [...res.data.results];
      // data.push(...res.data.results);
      data.push(res.data.results)
      console.log('datas =>', data)
      // return result;
      return res.data.results
    })
    .catch((err) => {
      console.log(err)
    })
}
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!