API called twice while useEffect triggered once. ReactJS/Javascript

i am building a project, in which when user click the buyNow button in Basket (child 2) it will pass the props back to parent where it further pass it to another child in Signin(child 3) where we call an API call(inside useEffect) to update the mysql database but it seems that the API call is called twice as in database two records are being created and in front end i got two identical invoices record but different file names. Any suggestion guys why i am facing this, please note if i remove the useEffect statement from the Signin it

extend existing API with custom endpoints

I’m creating an API for multiple customers. The core endpoints like /users are used by every customer but some endpoints rely on individual customization. So it might be that User A wants a special endpoint /groups and no other customer will have that feature. Just as a sidenote, each customer would also use his own database schema because of those extra features. I personally use NestJs (Express under the hood). So the app.module currently registers all my core modules (with their own endpoints etc.) I think this problem is not related to NestJs so how would you handle that in