async buyProduct()

in client/src/components/product-item.js [120:133]


  async buyProduct(event) {
    event?.preventDefault();

    if (this.state.count > 0) {
      await buyProduct(this.productItem?.id, () => {
        this.state.count--;
        // Open fake product dialog
        this.toggleDialog();
      });
    } else {
      // Open sold out dialog
      this.toggleSoldOutDialog();
    }
  }