export class DevingenDataProviderProducts {
  constructor(devingenApi, workspaceId, productType = '') {
    this.devingenApi = devingenApi;
    this.workspaceId = workspaceId;
    this.productType = productType;
  }
  getInitialData() {
    return this.getData();
  }
  getData() {
    const { productType, workspaceId } = this;
    return new Promise((resolve) => {
      this.devingenApi.getProducts({ productType, workspaceId })
        .then(response => resolve(response.results.sort((a, b) => a.name.localeCompare(b.name))));
    });
  }
  getQuickSearchText() {
    return '';
  }
  isQuickSearchEnabled() {
    return false;
  }
  setInitialData(_data) {
  }
  setQuickSearchText(_text) {
  }
}
