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

145
Views
Cómo reducir las llamadas repetidas de strapi api

Tengo el siguiente código

 const getData = async (): Promise<void> => { const { page, pageSize } = pageOption try { setShowContentLoader(true) const { data: isActiveData } = await axiosStrapi.get('/changelog-sellers?isActive=true&_sort=id:DESC') const { data: pageOptionRows } = await axiosStrapi.get(`/changelog-sellers?_start=${(page - 1) * pageSize}&_limit=${pageSize}&_sort=id:DESC`) const { data: rows } = await axiosStrapi.get(`/changelog-sellers?type=${type}&_start=${(page - 1) * pageSize}&_limit=${pageSize}&_sort=id:DESC`) const { data: oldRows } = await axiosStrapi.get('/changelog-sellers?_start=0&_limit=10&_sort=id:DESC') setFeaturedPosts(isActiveData.slice(0, 3)) setOldChangelogSellers(oldRows) if (type === 'all') { const { data: count } = await axiosStrapi.get('/changelog-sellers/count') setTotal(count) setChangelogSellers(pageOptionRows) } else { const { data: tabTitleCount } = await axiosStrapi.get(`/changelog-sellers/count?type=${type}`) setTotal(tabTitleCount) setChangelogSellers(rows) } } catch (error) { console.log('error', error) } finally { setShowContentLoader(false) } }

Estoy llamando repetidamente a /changelog-sellers para obtener diferentes tipos de datos. ¿Hay alguna manera de simplificar mi código para que solo llame una vez a /changelog-sellers ? ¿O es imposible porque necesito pasar diferentes parámetros a cada una de las diferentes llamadas de API a pesar de que todas provienen de /changelog-sellers ?

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!