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

274
Vistas
NextJs GetServerSideProps after update how can i call?

Below I am pulling all the data from the database. But let's say I deleted one piece of data. How can I retrieve the renewed data? How can I run it again?

export async function getServerSideProps() {
  const res = await fetch(`http://localhost:8000/api/getAllShipmentTypes`);
  const shipmentTypes = await res.json();

  return {
    props: { shipmentTypes } // will be passed to the page component as props
  };
}

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

But let's say I deleted one piece of data. How can I retrieve the renewed data?

I think you will need to define what is the trigger for the deletion, I can think of these two.

  1. Another action user performs on a page.
  2. Some other system modifying the database that this client application shows.

For #1, To the action, say a button click you can use a router object to set the same route again which will run getServerSideProps again

When you request this page on client-side page transitions through next/link or next/router, Next.js sends an API request to the server, which runs getServerSideProps

For #2 - this would be handled by giving the user an option to refetch the data from the server again using a link or router component

about 4 years ago · Juan Pablo Isaza Denunciar
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