{"size": 744, "ext": "js", "max_stars_repo_path": "public/js/boards.js", "max_stars_repo_name": "JMarie39/Trone", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "public/js/boards.js", "max_issues_repo_name": "JMarie39/Trone", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "public/js/boards.js", "max_forks_repo_name": "JMarie39/Trone", "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": 32.347826087, "max_line_length": 76, "alphanum_fraction": 0.373655914}
$(document).ready(function () {
    $('.fave-button').click(isFavorite);

    function isFavorite() {
        var boardId = $(this).val();
        $.post(`/${boardId}/clicked?_method=PATCH`, { boardId }, (data) => {
            if (data) {
                if ($(this).children('i').hasClass('fas fa-star')) {
                    $(this)
                        .children('i')
                        .removeClass('fas fa-star')
                        .addClass('fas fa-star-half-alt');
                } else {
                    $(this)
                        .children('i')
                        .removeClass('fas fa-star-half-alt')
                        .addClass('fas fa-star');
                }
            }
        });
    }
});
