{"size": 678, "ext": "js", "max_stars_repo_path": "src/util/api-voucherify.js", "max_stars_repo_name": "Maksym-Zyza/ftw-daily", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/util/api-voucherify.js", "max_issues_repo_name": "Maksym-Zyza/ftw-daily", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/util/api-voucherify.js", "max_forks_repo_name": "Maksym-Zyza/ftw-daily", "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": 25.1111111111, "max_line_length": 98, "alphanum_fraction": 0.6887905605}
import PropTypes from 'prop-types';

const myHeaders = new Headers();
myHeaders.append('X-App-Id', 'a319c47d-cdff-4344-9b53-757d3de8d44c');
myHeaders.append('X-App-Token', 'ef0f06eb-3ff5-4b58-b018-b677c1b21142');
myHeaders.append('Content-Type', 'application/json');

const requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow',
};

export const getVoucher = async function(code) {
  try {
    const response = await fetch(`https://api.voucherify.io/v1/vouchers/${code}`, requestOptions);
    return response;
  } catch (error) {
    console.log(error);
    return [];
  }
};

// getSerchMovies.propTypes = {
//   code: PropTypes.code.isRequired,
// };
