Sep 29, 2021
0
Level 7
2 Inertia patch requests to same endpoint, from different components. one being cancelled.
I am trying to implement a feature that on mounted, if certain data is in local storage, then to make a patch request with inertia.
<page-component>
<child-component-1/> //makes patch request on the mounted() hook that is cancelled.
<child-component-2/> //makes same patch request on the mounted() hook and succeeds.
</page-component>
As far as I can see, the reason this is, is because the first child component is unmounted when the second component sends its request, which is causing the browser to cancel the request. Is there any way to fix this issue?
Please or to participate in this conversation.