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

391
Views
¿Cómo mutar en SWR con parámetros de consulta de dicha página después de la solicitud de parche exitosa?
onSubmit={async (values, actions) => { const { birthdate, ...userData } = values; let formattedBirthDate = formatDate(birthdate); const updateUserUrl = `/api/users/update/${id}`; try { // send a request to the API to update the source const res = await api.patch( updateUserUrl, { ...userData, birthdate: formattedBirthDate, }, { headers: { "Auth-Token": authToken } } ); if (res && res.data) { mutate('api/users?page=1&limit=10',{ ...user, userData, birthdate: formattedBirthDate }); router.replace("/admin?page=1&limit=10"); toast.success("Updated successfully"); } } catch (error) { if (error.response) { // The request was made and the server responded with a status code // that falls out of the range of 2xx toast.error(error.response.data.message); console.log("Error response data: ", error.response.data); console.log("Error response status: ", error.response.status); console.log( "Error response headers: ,", error.response.headers ); } else { console.log("Error entity error: ", error.message); toast.error(error.message); } }

Estoy tratando de mutar los datos de la tabla para tener datos actualizados, pero no funcionará si la URL mutada no es correcta. Si la obtención de datos actual es de la página 2, la URL mutada será api/users?page=2&limit=10 . ¿Cómo puedo saber si los datos actuales son de la page =2 ?

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!