Nextjs request's order in async api
I have api endpoint to handle payment webhook requests. So it's multiple requests one by one which changes status of transaction and sometimes mine database updated in a wrong order. How it possible to ensure right order of requests in nextjs 13 ?
4 Replies
Are promises not working,have you tried chaining one after the other
i've tried but not really working
only if i put sleep for few second it's working but it looks like a bad solution\
because you are in the case statement where the case of event is order updated the same event exists down the chain of promises,i think the process is right but its just the console logging that says otherwise because it is the same event at the top