import { Magento2AbstractApiService } from '../magento2.abstract.api.service';

export class WidgetsProductsService extends Magento2AbstractApiService {

  public url: string = location.hostname;

  constructor(
    public $http,
    public $q,
    public API_URL,
    public API_PRODUCTS_ENDPOINT
  ) {
    super($http, $q, API_URL, API_PRODUCTS_ENDPOINT);
  }

  public setUrl(url: string) {
    this.url = url;
  }

  public get(entityIds: string): Promise<any> {
    return super.get('entity_id', entityIds, 'created_at', 'DESC');
  }

}
