"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.webhookCustomersDataRequest = void 0;

var _utils = require("../helpers/utils");

const webhookCustomersDataRequest = async (req, res, config) => (0, _utils.handler)(_utils.verifyWebhook, async data => {
  const shop = data.get("x-shopify-shop-domain"); // const customers: any = data.body.customers

  try {
    // TODO: Retrieve customer data here
    console.log(`Customers requested ${shop}`);
    res.status(200).json({
      status: "success",
      body: `Customers requested ${shop}`
    });
  } catch (err) {
    console.log(err.message);
    res.status(200).json({
      status: "error",
      body: err.message
    });
  }
})(req, res, config);

exports.webhookCustomersDataRequest = webhookCustomersDataRequest;
//# sourceMappingURL=customers-data-request.js.map