April 2019
Intermediate to advanced
490 pages
12h 6m
English
Let's work on creating the required functionality for the Sell.js function so that you can start adding purchasable products to the marketplace. In this case, we need to add a function that will call the publishProduct() function from the smart contract. Here's how the updated publish function looks:
async publishProduct() { if(this.state.title.length == 0) return alert('You must set the title before publishing the product') if(this.state.description.length == 0) return alert('You must set the description before publishing the product') if(this.state.price.length == 0) return alert('You must set the price before publishing the product') if(this.state.image.length == 0) return alert('You must set the image URL before ...Read now
Unlock full access