<commit_before>"use strict";

angular.module('IssueTrackingSystem.services.issues', [])
    .factory('issues', ['$http', '$q', 'BASE_URL', 'header',
        function ($http, $q, BASE_URL, header) {

            function getAllIssues(status, dueDate, pageSize, pageNumber) {
                var deferred = $q.defer();

                $http({
                    method: 'get',
                    url: BASE_URL + 'issues/?filter=Status.Name == ' + status
                                    + ' or DueDate.Day <= ' + dueDate
                                    + '&pageSize=' + pageSize
                                    + '&pageNumber=' + pageNumber,
                    headers: header.authenticationHeader()
                }).then(function (success) {
                    deferred.resolve(success);
                }).then(function (error) {
                    deferred.reject(error);
                });

                return deferred.promise;
            }

            function getActiveUserIssues(pageSize, pageNumber, orderBy) {
                var deferred = $q.defer();

                $http({
                    method : 'get',
                    url : BASE_URL + 'issues/me?pageSize=' + pageSize
                                    + '&pageNumber=' + pageNumber
                                    + '&orderBy=' + orderBy,
                    headers : header.authenticationHeader()
                }).then(function (succes) {
                    deferred.resolve(succes);
                }, function (error) {
                    deferred.reject(error);
                });

                return deferred.promise;
            }

            function getIssuesById(id) {
                var deferred = $q.defer();

                $http({
                    method: 'get',
                    url: BASE_URL + 'issues/' + id,
                    headers : header.authenticationHeader()
                }).then(function (succes) {
                    deferred.resolve(succes);
                }, function (error) {
                    deferred.reject(error);
                });

                return deferred.promise;
            }

            function addIssue(issue) {
                var deferred = $q.defer();

                $http({
                    method : 'post',
                    url : BASE_URL + 'issues/',
                    data : issue,
                    headers : header.authenticationHeader()
                }).then(function (success) {
                    deferred.resolve(success);
                }, function (error) {
                    deferred.reject(error);
                });

                return deferred.promise;
            }

            function editIssueById(id, issue) {
                var deferred = $q.defer();

                $http({
                    method : 'put',
                    url : BASE_URL + 'issues/' + id,
                    data : issue,
                    headers : header.authenticationHeader()
                }).then(function (success) {
                    deferred.resolve(success);
                }, function (error) {
                    deferred.reject(error);
                });

                return deferred.promise;
            }

            function editIssueStatus(id, statusId) {
                var deferred = $q.defer();

                $http({
                    method : 'put',
                    url : BASE_URL + 'issues/' + id +'/changestatus?statusid=' + statusId,
                    data : null,
                    headers : header.authenticationHeader()
                }).then(function (success) {
                    deferred.resolve(success);
                }, function (error) {
                    deferred.reject(error);
                });

                return deferred.promise;
            }

            function getAllIssueComments(id) {
                var deferred = $q.defer();

                $http({
                    method : 'get',
                    url : BASE_URL + 'issues/' + id + '/comments',
                    headers : header.authenticationHeader()
                }).then(function (success) {
                    deferred.resolve(success);
                }, function (error) {
                    deferred.reject(error);
                });

                return deferred.promise;
            }

            return {
                getAllIssues : getAllIssues,
                getActiveUserIssues : getActiveUserIssues,
                getIssuesById : getIssuesById,
                addIssue : addIssue,
                editIssueById : editIssueById,
                editIssueStatus : editIssueStatus,
                getAllIssueComments : getAllIssueComments
            };

        }]);<commit_msg>create addCommentToIssue method with parameters id - number and comment - {}<commit_after>"use strict";

angular.module('IssueTrackingSystem.services.issues', [])
    .factory('issues', ['$http', '$q', 'BASE_URL', 'header',
        function ($http, $q, BASE_URL, header) {

            function getAllIssues(status, dueDate, pageSize, pageNumber) {
                var deferred = $q.defer();

                $http({
                    method: 'get',
                    url: BASE_URL + 'issues/?filter=Status.Name == ' + status
                                    + ' or DueDate.Day <= ' + dueDate
                                    + '&pageSize=' + pageSize
                                    + '&pageNumber=' + pageNumber,
                    headers: header.authenticationHeader()
                }).then(function (success) {
                    deferred.resolve(success);
                }).then(function (error) {
                    deferred.reject(error);
                });

                return deferred.promise;
            }

            function getActiveUserIssues(pageSize, pageNumber, orderBy) {
                var deferred = $q.defer();

                $http({
                    method : 'get',
                    url : BASE_URL + 'issues/me?pageSize=' + pageSize
                                    + '&pageNumber=' + pageNumber
                                    + '&orderBy=' + orderBy,
                    headers : header.authenticationHeader()
                }).then(function (succes) {
                    deferred.resolve(succes);
                }, function (error) {
                    deferred.reject(error);
                });

                return deferred.promise;
            }

            function getIssuesById(id) {
                var deferred = $q.defer();

                $http({
                    method: 'get',
                    url: BASE_URL + 'issues/' + id,
                    headers : header.authenticationHeader()
                }).then(function (succes) {
                    deferred.resolve(succes);
                }, function (error) {
                    deferred.reject(error);
                });

                return deferred.promise;
            }

            function addIssue(issue) {
                var deferred = $q.defer();

                $http({
                    method : 'post',
                    url : BASE_URL + 'issues/',
                    data : issue,
                    headers : header.authenticationHeader()
                }).then(function (success) {
                    deferred.resolve(success);
                }, function (error) {
                    deferred.reject(error);
                });

                return deferred.promise;
            }

            function editIssueById(id, issue) {
                var deferred = $q.defer();

                $http({
                    method : 'put',
                    url : BASE_URL + 'issues/' + id,
                    data : issue,
                    headers : header.authenticationHeader()
                }).then(function (success) {
                    deferred.resolve(success);
                }, function (error) {
                    deferred.reject(error);
                });

                return deferred.promise;
            }

            function editIssueStatus(id, statusId) {
                var deferred = $q.defer();

                $http({
                    method : 'put',
                    url : BASE_URL + 'issues/' + id +'/changestatus?statusid=' + statusId,
                    data : null,
                    headers : header.authenticationHeader()
                }).then(function (success) {
                    deferred.resolve(success);
                }, function (error) {
                    deferred.reject(error);
                });

                return deferred.promise;
            }

            function getAllIssueComments(id) {
                var deferred = $q.defer();

                $http({
                    method : 'get',
                    url : BASE_URL + 'issues/' + id + '/comments',
                    headers : header.authenticationHeader()
                }).then(function (success) {
                    deferred.resolve(success);
                }, function (error) {
                    deferred.reject(error);
                });

                return deferred.promise;
            }

            function addCommentToIssue(id, comment) {
                var deferred = $q.defer();

                $http({
                    method : 'post',
                    url : BASE_URL + 'issues/' + id + '/comments',
                    data : comment,
                    headers : header.authenticationHeader()
                }).then(function (success) {
                    deferred.resolve(success);
                }, function (error) {
                    deferred.reject(error);
                });

                return deferred.promise;
            }

            return {
                getAllIssues : getAllIssues,
                getActiveUserIssues : getActiveUserIssues,
                getIssuesById : getIssuesById,
                addIssue : addIssue,
                editIssueById : editIssueById,
                editIssueStatus : editIssueStatus,
                getAllIssueComments : getAllIssueComments,
                addCommentToIssue : addCommentToIssue
            };

        }]);
{'fraction_non_alphanumeric': 0.10378188214599825, 'fraction_numerical': 0.0, 'mean_word_length': 1.0500801282051282, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '133505', 'n_tokens_mistral': 2556, 'n_tokens_neox': 2231, 'n_words': 453}