Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

161
Visualizações
How to implement an Axios interceptor for batching requests?

I have an API that takes comma-separated or an array of ids and sends a response for each id if it's available on the server

https://europe-west1-quickstart-1573558070219.cloudfunctions.net/file-batch-api?ids=fileid1,fileid2,fileid3

If a file with id cannot be found or returns an error, it is not provided in the response items array. For example, if fileid1, fileid2, and fileid3 are requested, but fileid3 cannot be found, the return value is: items: [{id: "fileid1"}, {id: "fileid2"}]

I have created an axios interceptor that combines the params of the incoming requests, cancels the requests and sends a single request with all the params. This seems to be working and I get the data in the interceptor, but I'm unable to get the response back to the original HTTP caller in App.js How do I get the final response back in my original call?

I have created a Stackblitz example here.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda