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

161
Views
RTK Query API get req falla en el entorno implementado

Recientemente implementé un proyecto my-react-app en páginas de github con el paquete npm gh-pages.

Tengo una consulta RTK que no funciona en el entorno implementado, pero aún funciona en mi entorno de desarrollo. a continuación se muestra el código para la consulta RTK y luego el código que llama a la consulta en el componente de reacción.

Me preguntaba qué podría estar causando el error.

 getUni: builder.query({ query: country => ({ url: `http://universities.hipolabs.com/search?country=${country}`, }), transformResponse: responseData => { const resConvert = responseData.slice() .sort((a, b) => a.name.localeCompare(b.name)) .map(each => { return { ...each, id: nanoid() } }); return universityAdapter.setAll(initialState, resConvert) } }) })

 const { isFetching, isSuccess, isUninitialized, isError } = useGetUniQuery(countrySearch, { skip }); const allUni = useSelector(getAllUniversity); if (isUninitialized) { universityData = < h1 > Use the drop down menu to generate all Post Secondary options withen your selection < /h1> } else if (isError) { universityData = < h1 > Error fetching.Please refresh page < /h1> } else if (isSuccess) { universityData = allUni.filter(uni => uni.name.toLowerCase().startsWith(uniSearch.toLowerCase())).map(uni => <div key = {uni.id} className = {CardStyles.card} > <h2 className = '' > {uni.name} </h2> <a href = {uni.web_pages[0]} > {uni.web_pages[0]} < /a> </div> ) }

about 4 years ago · Santiago Gelvez
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!