{"size": 725, "ext": "js", "max_stars_repo_path": "MyFit/src/database/ProductData.js", "max_stars_repo_name": "rosiiinka/MyFit", "max_stars_repo_stars_event_min_datetime": "2019-11-13T09:40:52.000Z", "max_stars_repo_stars_event_max_datetime": "2019-11-13T09:40:52.000Z", "max_issues_repo_path": "MyFit/src/database/ProductData.js", "max_issues_repo_name": "rosiiinka/MyFit", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "MyFit/src/database/ProductData.js", "max_forks_repo_name": "rosiiinka/MyFit", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.2083333333, "max_line_length": 68, "alphanum_fraction": 0.4331034483}
module.exports = {
    add: (product) => {
        return window.fetch('http://localhost:1337/products/add', {
            method: 'POST',
            body: JSON.stringify(product),
            mode: 'cors',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json'
            }
        }).then(res => res.json())
    },
    getAll: () => {
        return window.fetch('http://localhost:1337/products/all', {
            method: 'GET',
            mode: 'cors',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json'
            }
        }).then(res => res.json())
    }
}
