// @ngInject
export default function expertRequestsService(baseServiceClass, $q, $http, ENV) {
  let ServiceClass = baseServiceClass.extend({
    filterByCustomer: false,

    init: function () {
      this._super();
      this.endpoint = '/expert-requests/';
    },

    create: function (expertRequest) {
      return $http.post(`${ENV.apiEndpoint}api${this.endpoint}`, expertRequest)
        .then(response => response.data);
    },

    cancel: function (expertRequest) {
      return $http.post(`${expertRequest.url}cancel/`)
        .then(response => response.data);
    },

    getConfiguration: function () {
      return $http.get(`${ENV.apiEndpoint}api${this.endpoint}configured`)
        .then(response => response.data);
    }
  });
  return new ServiceClass();
}

// @ngInject
export default function expertRequestsService(baseServiceClass, $q, $http, ENV) {
  let ServiceClass = baseServiceClass.extend({
    filterByCustomer: false,

    init: function () {
      this._super();
      this.endpoint = '/expert-requests/';
    },

    create: function (expertRequest) {
      return $http.post(`${ENV.apiEndpoint}api${this.endpoint}`, expertRequest)
        .then(response => response.data);
    },

    cancel: function (expertRequest) {
      return $http.post(`${expertRequest.url}cancel/`)
        .then(response => response.data);
    },

    getConfiguration: function () {
      return $http.get(`${ENV.apiEndpoint}api${this.endpoint}configured/`)
        .then(response => response.data);
    }
  });
  return new ServiceClass();
}

Append missing slash to fix expert request URL.
Append missing slash to fix expert request URL.
