I am trying to check if the product with that id exist and if it is update quantity Pushing all of the created struct obj to and array of objects
contract TheStore is Ownable {
struct Store {
uint id;
uint quantity;
}
mapping(address => Store[]) public productsId;
Store[] public store;
function addProduct(uint id, uint quantity) public {
if(id == store.id){
product[id].quantity += quantity
}
store.push(Store({id: id ; quantity: quantity}));
}
function AllProducts() public view returns (Store[] memory)
{
return store;
}
}```