<commit_before>define(['lodash'], function(_) {
    'use strict';
    return ['createOrUpdateModal.userdata', '$scope', 'Restangular', function(employee, $scope, Restangular) {
        var controller = this;
        $scope.employee = _.clone(employee, false);

        controller.saveEntity = function(employee) {
            var request = Restangular.oneUrl('employees', 'api/employees/' + employee.id + '/self');
            _.assign(request, _.pick(employee, ['version', 'phoneNumber', 'firstName', 'lastName', 'address']));
            request.put()
                .then(function(updatedEmployee) {
                    $scope.closeModal(updatedEmployee);
                }, function(response) {
                    $scope.errors = response.data.errors;
                });
        };

        $scope.saveEntity = function() {
            controller.saveEntity($scope.employee);<commit_msg>TRACKR-234 - Track employee's contact address Also made a copy of the sub-address object when editing a self-employee<commit_after>define(['lodash'], function(_) {
    'use strict';
    return ['createOrUpdateModal.userdata', '$scope', 'Restangular', function(employee, $scope, Restangular) {
        var controller = this;
        $scope.employee = _.clone(employee, true);

        controller.saveEntity = function(employee) {
            var request = Restangular.oneUrl('employees', 'api/employees/' + employee.id + '/self');
            _.assign(request, _.pick(employee, ['version', 'phoneNumber', 'firstName', 'lastName', 'address']));
            request.put()
                .then(function(updatedEmployee) {
                    $scope.closeModal(updatedEmployee);
                }, function(response) {
                    $scope.errors = response.data.errors;
                });
        };

        $scope.saveEntity = function() {
            controller.saveEntity($scope.employee);
{'fraction_non_alphanumeric': 0.14225277630883132, 'fraction_numerical': 0.0015864621893178213, 'mean_word_length': 2.4525547445255476, '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': '6265094', 'n_tokens_mistral': 511, 'n_tokens_neox': 470, 'n_words': 97}