Now let's update the Orders.js component, which is the most elaborate component, given that we have to generate multiple products. Let's start by creating a function to get all the orders related to the current user, as shown in the following code:
async getOrders(amount) { const pendingSellerOrdersLength = parseInt(await contract.methods.getOrdersLength(this.bytes32('seller'), user).call()) const pendingBuyerOrdersLength = parseInt(await contract.methods.getOrdersLength(this.bytes32('buyer'), user).call()) const completedOrdersLength = parseInt(await contract.methods.getOrdersLength(this.bytes32('completed'), user).call()) const conditionSeller = (amount > pendingSellerOrdersLength) ? 0 : pendingSellerOrdersLength ...