{"size": 589, "ext": "js", "max_stars_repo_path": "src/api-requests/post-reordered-urls.js", "max_stars_repo_name": "Cadburylion/voyageurl", "max_stars_repo_stars_event_min_datetime": "2019-04-18T05:15:31.000Z", "max_stars_repo_stars_event_max_datetime": "2019-04-18T05:15:31.000Z", "max_issues_repo_path": "src/api-requests/post-reordered-urls.js", "max_issues_repo_name": "Cadburylion/voyageurl", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/api-requests/post-reordered-urls.js", "max_forks_repo_name": "Cadburylion/voyageurl", "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": 26.7727272727, "max_line_length": 63, "alphanum_fraction": 0.5806451613}
export const postReorderedURLs = async (urls, userId) => {
  const reorderedURLs = urls.map(url => url._id);
  const settings = {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    credentials: 'include',
    body: JSON.stringify({ id: userId, urls: reorderedURLs }),
  };
  const result = await fetch(
    `${process.env.REACT_APP_DOMAIN}/user/reorder-urls`,
    settings
  )
    .then(res => res.json())
    .then(json => {
      return json;
    })
    .catch(err => console.log('fetch user error: ', err));
  return result;
};
