private putReviewer()

in web/rv-filter-section.ts [221:241]


  private putReviewer(reviewer: string, action: Action, type: Type) {
    if (this.filter === '') throw new Error('empty filter');
    if (reviewer === '') throw new Error('empty reviewer');
    return this.pluginRestApi
      .put<Section[]>(this.reviewersUrl, {
        action,
        reviewer,
        type,
        filter: this.filter,
      })
      .then((sections: Section[]) => {
        // Even if just one reviewer is changed or deleted, we will get the
        // the complete list of sections back from the server, and we dispatch
        // this event such that the entire dialog re-renders from scratch.
        // Lit is smart enough to re-use the component though, so we also want
        // to re-initialize the state here:
        this.editingReviewer = false;
        this.originalFilter = this.filter;
        fire(this, 'reviewer-changed', sections);
      });
  }