{"size": 535, "ext": "js", "max_stars_repo_path": "src/utils/api.js", "max_stars_repo_name": "itscarlosisaac/pcine", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/utils/api.js", "max_issues_repo_name": "itscarlosisaac/pcine", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/utils/api.js", "max_forks_repo_name": "itscarlosisaac/pcine", "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": 31.4705882353, "max_line_length": 106, "alphanum_fraction": 0.5495327103}
import axios from 'axios';

module.exports = {
    fetchMovies: function () {
        const URL = "http://cine.awesomemedia.do/api/movies"
        return axios.get(URL)
            .then((response) => {
                return response.data.result
            })
            .catch((e) => {
                console.log(`Something went wrong ${e}`)
            })
    },
    filterMovies: function(searchText, movieArray){
        return movieArray.filter( (item) => item.title.toLowerCase().includes(searchText.toLowerCase()) );
    }
}