'How to prevent angular application making a api call twice when the second call is not appearing on the network?

I am calling one api in angular to save the data to backend but sometimes data is getting saved twice but in network tab it shows the api is called only once. What can be the issue I am using post method to save the data and it is an observable even user will not be able to make a second call untill first one is completed and even if he tries to hit api twice it shows on network tab that we have called the api twice but in normal case when we are calling api only once that time data is getting saved twice sometimes only. Any solution for this please I am trying to resolve this issue but not able to find the actual cause.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source