<commit_before>var Account = require('../../app/models/account');

exports.update = function (req, res) {
    Account.findById(req.params.id, function (err, account) {
        if (!account)
            return next(new Error('Could not load Document'));
        else {
            if (req.body.foreName) {
                account.foreName = req.body.foreName
            }
            if (req.body.sureName) {
                account.sureName = req.body.sureName
            }
            if (req.body.phoneNumber) {
                account.phoneNumber = req.body.phoneNumber
            }

            account.save(function (err) {
                if (err)
                    res.json({ message: 'Error' });
                else
                    res.json({ message: 'Account Updated' });
            });
        }
    });
}<commit_msg>Update now returns the account info<commit_after>var Account = require('../../app/models/account');

exports.update = function (req, res) {
    Account.findById(req.params.id, function (err, account) {
        if (!account)
            return next(new Error('Could not load Document'));
        else {
            if (req.body.foreName) {
                account.foreName = req.body.foreName
            }
            if (req.body.sureName) {
                account.sureName = req.body.sureName
            }
            if (req.body.phoneNumber) {
                account.phoneNumber = req.body.phoneNumber
            }

            account.save(function (err) {
                if (err)
                    res.json({ message: 'Error' });
                else
                    res.json(account);
            });
        }
    });
}
{'fraction_non_alphanumeric': 0.12343470483005367, 'fraction_numerical': 0.0, 'mean_word_length': 1.350140056022409, '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': '5791884', 'n_tokens_mistral': 449, 'n_tokens_neox': 431, 'n_words': 90}