<commit_before>angular.module('company')
    .service('companyRestService', ['$http', 'Upload', 'restConfigService' , function($http, Upload, restConfigService) {

        var listOperation = restConfigService.getOperation('/companies');

        return {

            list: function () {
                return $http.get(listOperation).then(function (response) {
                    var data = response.data;
                    if(response.data) {
                        return data.elements;
                    }
                    return response;
                });
            },

            get: function (id) {
                return $http.get(listOperation + '/' + id).then(function (response) {
                    return response.data;
                });
            },

            createOrUpdate: function (company, imageFile, isEditing) {
                return Upload.upload({
                    url: isEditing ? (listOperation + '/' + company.id) : listOperation,
                    method: isEditing ? 'PUT' : 'POST',
                    file: imageFile,
                    data: company
                })
            },

            delete: function(company) {
                return $http.delete(listOperation + '/' + company.id);
            },

            default: function() {
                return {
                    name: 'New Company'
                };
            }
        };
    }]);<commit_msg>RUN-78 fixed the JavaScript error.<commit_after>angular.module('company')
    .service('companyRestService', ['$http', 'Upload', 'restConfigService' , function($http, Upload, restConfigService) {

        var listOperation = restConfigService.getOperation('/companies');

        return {

            list: function () {
                return $http.get(listOperation).then(function (response) {
                    var data = response.data;
                    if(response.data) {
                        return data.elements;
                    }
                    return response;
                });
            },

            get: function (id) {
                return $http.get(listOperation + '/' + id).then(function (response) {
                    return response.data;
                });
            },

            createOrUpdate: function (company, imageFile, isEditing) {
                return Upload.upload({
                    url: isEditing ? (listOperation + '/' + company.id) : listOperation,
                    method: isEditing ? 'PUT' : 'POST',
                    file: imageFile,
                    data: company
                });
            },

            delete: function(company) {
                return $http.delete(listOperation + '/' + company.id);
            },

            default: function() {
                return {
                    name: 'New Company'
                };
            }
        };
    }]);
{'fraction_non_alphanumeric': 0.11344827586206896, 'fraction_numerical': 0.000689655172413793, 'mean_word_length': 1.2195868400918133, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6079048', 'n_tokens_mistral': 706, 'n_tokens_neox': 648, 'n_words': 134}