{"size": 346, "ext": "js", "max_stars_repo_path": "api/src/controllers/wishlist/getId.js", "max_stars_repo_name": "Drivello/On-The-Rocks", "max_stars_repo_stars_event_min_datetime": "2021-10-06T19:23:04.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-08T15:57:27.000Z", "max_issues_repo_path": "api/src/controllers/wishlist/getId.js", "max_issues_repo_name": "Drivello/On-The-Rocks", "max_issues_repo_issues_event_min_datetime": "2021-08-23T02:19:48.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-30T16:38:43.000Z", "max_forks_repo_path": "api/src/controllers/wishlist/getId.js", "max_forks_repo_name": "Drivello/On-The-Rocks", "max_forks_repo_forks_event_min_datetime": "2021-09-07T01:35:55.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-07T01:35:55.000Z"}
{"max_stars_count": 2, "max_issues_count": 11, "max_forks_count": 1, "avg_line_length": 21.625, "max_line_length": 56, "alphanum_fraction": 0.5606936416}
const { Wishlist } = require("../../db");

module.exports = async (req, res, next) => {
  let { id } = req.query;
  try {
    let wishlist = await Wishlist.findAll();
    
    let filter = wishlist.filter((e) => e.userId == id);
    

    return res.json(filter);
  } catch (err) {
    return res.send({ error: err.message }).status(409);
  }
};
