{"size": 688, "ext": "js", "max_stars_repo_path": "functions/retrieve-item-stock.js", "max_stars_repo_name": "nasnyder91/gatsby-netlify-cms-template", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "functions/retrieve-item-stock.js", "max_issues_repo_name": "nasnyder91/gatsby-netlify-cms-template", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "functions/retrieve-item-stock.js", "max_forks_repo_name": "nasnyder91/gatsby-netlify-cms-template", "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": 29.9130434783, "max_line_length": 165, "alphanum_fraction": 0.4970930233}
const fetch = require("node-fetch");

module.exports.handler = async (event, context) => {
    return fetch(
        `https://sandbox.dev.clover.com/v3/merchants/J9MV77D46ST91/item_stocks/${event.queryStringParameters.id}?access_token=582540d1-2fa6-dd03-7699-e107e6c03c0d`,
        {
            method: "GET",
            headers: {
                Accept: "application/json",
            },
        },
    )
        .then((response) => response.json())
        .then((data) => ({
            statusCode: 200,
            body: JSON.stringify(data),
        }))
        .catch((err) => ({
            statusCode: 422,
            body: String(err),
        }));
};
