{"size": 435, "ext": "js", "max_stars_repo_path": "server/routes/sp-customers/getCustomersHandler.js", "max_stars_repo_name": "juliocd/shopify-js-test", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server/routes/sp-customers/getCustomersHandler.js", "max_issues_repo_name": "juliocd/shopify-js-test", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server/routes/sp-customers/getCustomersHandler.js", "max_forks_repo_name": "juliocd/shopify-js-test", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 17.4, "max_line_length": 68, "alphanum_fraction": 0.6183908046}
import {getCustomers} from "../../datasource/shopify-api/customers";

const getCustomersHandler = async (ctx) => {
  let customers;

  try {
    customers = await getCustomers(ctx);
  } catch (err) {
    ctx.body = {
      success: false,
      error: 'Unable to retrieve customers'
    };
    console.log('err', err)

    return;
  }

  ctx.body = {
    success: true,
    data: customers
  };
};

export default getCustomersHandler;
