async subscribeToShow()

in public/js/account.js [71:90]


  async subscribeToShow(show) {
    if (this.model.isLinked) {
      await fetch("/api/user-spotify-add-entitlements", {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({ entitlements: [show] }),
      });
    } else {
      await fetch("/api/update-subscription", {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({
          entitlements: Array.from(
            new Set([...this.model.subscriptions, show])
          ),
        }),
      });
    }
    this.model.syncSubscriptions();
  }