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

105
Vistas
How to reset the next_page url to list out the whole data in javascript

How can I set the "next_page" url to replace the GetUrl until the "next_page" is null?

The first "GetUrl", I need to set it manually. And then I will get the data which include "next_page" value. I would like to call back the function and reset the "GetUrl" till it's null. So that I can be able to list the whole data from the API. Can someone help to give some suggestion how I can do it in JavaScript? Thanks .

const getFieldsFromApi = async () => {
    const GetUrl = "abc.net"
    const Doorkey = {username: "token", password: "token"}
    const response = await Axios.get(GetUrl, {auth: Doorkey})
    // console.log ("here I am able to console.log the next_page url", response.data.next_page)
    return response.data.users
}

const getData = async () => {
    const values = await getFieldsFromApi()
    values.forEach(field => {
        const row = document.createElement("tr");
        row.appendChild(addCell(field.name));
        row.appendChild(addCell(field.email)); 
        tblbody.appendChild(row);
    })
};
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