Closed bhavy3103 closed 1 month ago
try to solve the issue of duplicate stock entry in the same mutual funds. Update the googleLogin function and add a filter there to remove duplicate stocks using the filter on ISIN.
setStockDetails((prevDetails) => { const uniqueStocks = [...prevDetails, stockDetail].filter( (stock, index, self) => index === self.findIndex((s) => s.ISIN === stock.ISIN) ) return uniqueStocks; })
like above way
@bhavy3103 is attempting to deploy a commit to the shivamsouravjha's projects Team on Vercel.
A member of the Team first needs to authorize it.
try to solve the issue of duplicate stock entry in the same mutual funds. Update the googleLogin function and add a filter there to remove duplicate stocks using the filter on ISIN.
setStockDetails((prevDetails) => { const uniqueStocks = [...prevDetails, stockDetail].filter( (stock, index, self) => index === self.findIndex((s) => s.ISIN === stock.ISIN) ) return uniqueStocks; })
like above way