Linked Questions
12 questions linked to/from using a fetch inside another fetch in javascript
1 vote
1 answer
7k views
Javascript: how to wait for result of one fetch then start another [duplicate]
This code is definitely wrong, but I'm not sure how to fix it. E.g. fetch('api/foo?get_max=True') .then( function(response) { return response.json(); } .then( function(response)...
2 votes
3 answers
4k views
How to structure nested Promises
I have a situation where I think the only choice for me is to nest some Promises within each other. I have a Promise that needs to be performed and a method that does something until that Promise is ...
3 votes
2 answers
2k views
How to execute two actions with one ajax call - WordPress
I have a section for "tours" in my page. The tours have 2 filters (select inputs). "destino" and "duracion" (location and duration) So far I made one of the filter work ...
3 votes
2 answers
1k views
How to fetch sequence api calls where second api call need particular data from first api call result using react hooks?
When I make first api call, I get json data containing all the race cars info. Then when I make second api call to retrieve info for corresponding individual driver, I need driverId in api endpoint. ...
2 votes
2 answers
2k views
Reactjs - What is optimized way for multiple api calls?
I am using useEffect, useState and fetch. On page load i got a list of project ids. then i am calling api on base of those ids. In this way my application get slow down and their is chance to lose ...
0 votes
2 answers
968 views
React Component always reverts to the last item in array
This is a React/Redux app. I have two components. One nested in the other. <UserReview> <UserReviewItem> </UserReview> I am working with two APIs. I call one API to get a '...
0 votes
2 answers
914 views
How to pass data between nested fetch function
I am using the results from one fetch to generate some elements for a div in my HTML. Within these fetched elements is a list of URLS I am using to fetch some additional elements. My goal is to merge ...
0 votes
1 answer
898 views
How can I visualize an API mashup in Postman?
I have a REST API of classical actors that I want to visualize in Postman. The image URL of an actor is not in the API, so I will need to create a mashup from a combination of the core API and another ...
0 votes
2 answers
663 views
Passing a value from one request to another request in ReactJs
I need help because I couldn't use a separate function to generate the token - it gives out a promise, not a value. I was told that a value can only be used inside a function. For each request, I ...
0 votes
3 answers
564 views
Object property coming up as undefined after assigning with an async fetch
I'm having some trouble with adding a key to an object as seen here: const recursiveFetchAndWait = useCallback( (url) => { setLoading(true); fetch(url) ...
0 votes
2 answers
482 views
Add additional data(ajax) to native authentication in Laravel
I am trying to implement user tracking in Laravel by writing statistics after user login. I.e, location, timezone and such. I sort of had a half luck of implementing it. I used ajax by attaching ...
0 votes
1 answer
31 views
fetch inside reducer is not working if I use too many .thens
I'm doing a GetList api call and after I get response I'm making another api call. dispatchUpdateHeader should happen after all the calls are done. But its not working. Is it good idea to write too ...