/* xeslint-disable */
import apiUtil from "./apiutil";
export default {
  fetch(route, listOptions) {
    // listOptions;

    // var futureWithSortExampleListOptions = {
    //   offset: 5,
    //   limit: 5,
    //   sortBy: "name",
    //   descending: false
    // };
    // exampleListOptions;

    var listUrl = route + "?" + apiUtil.buildQuery(listOptions);

    return new Promise(function(resolve, reject) {
      fetch(apiUtil.APIUrl(listUrl), apiUtil.fetchGetOptions())
        .then(apiUtil.status)
        .then(apiUtil.json)
        .then(response => {
          resolve(response);
        })
        .catch(function(error) {
          reject(error);
        });
    });
  }
};
