<commit_before>/* global app, angular */

'use strict';

app.controller('UserSettingsCtrl', function ($scope, $location, auth, usersData, identity, notifier) {

    $scope.user = {
        username: identity.currentUser.username,
        firstName: identity.currentUser.firstName,
        lastName: identity.currentUser.lastName,
        phone: identity.currentUser.phone,
        city: identity.currentUser.city,
        imageUrl: identity.currentUser.imageUrl
    };

    $scope.submit = function (updatedUser) {
        usersData.update(updatedUser).then(function () {
            notifier.success('Updated successfully!');
            auth.logout();
            $location.path('/login');
        }, function (err) {
            notifier.error('Update error: ' + err);
        });
    };
});<commit_msg>updated err notif<commit_after>/* global app, angular */

'use strict';

app.controller('UserSettingsCtrl', function ($scope, $location, auth, usersData, identity, notifier) {

    $scope.user = {
        username: identity.currentUser.username,
        firstName: identity.currentUser.firstName,
        lastName: identity.currentUser.lastName,
        phone: identity.currentUser.phone,
        city: identity.currentUser.city,
        imageUrl: identity.currentUser.imageUrl
    };

    $scope.submit = function (updatedUser) {
        usersData.update(updatedUser).then(function () {
            notifier.success('Updated successfully!');
            auth.logout();
            $location.path('/login');
        }, function (err) {
            notifier.error(err.message);
        });
    };
});
{'fraction_non_alphanumeric': 0.13395638629283488, 'fraction_numerical': 0.0, 'mean_word_length': 2.6666666666666665, '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': '3504538', 'n_tokens_mistral': 435, 'n_tokens_neox': 430, 'n_words': 80}