<commit_before>'use strict';

const Queries = require('../../helpers/queries');
const D3 = require('d3');
const Utils = require('./utils');


exports.getData = {
    handler: function(request, reply) {

        var sequelize = request.server.plugins.sequelize.db.sequelize;
        var userId = request.auth.credentials.id;
        var queryString = Queries.contact(userId);

        sequelize.query(queryString, {
            type: sequelize.QueryTypes.SELECT
        }).then(function(rows) {

            var contactResponse = D3.values(rows[0]);
            var regionsResponse = D3.values(rows[1]);

            var subjectLine = Utils.buildSubject(contactResponse[0].subject, regionsResponse);
            var data = {
                'phone': contactResponse[0].phone,
                'email': contactResponse[0].email,
                'subject': subjectLine
            }

            reply(data);
        });
    }
};
<commit_msg>Cleanup<commit_after>'use strict';

const Queries = require('../../helpers/queries');
const D3 = require('d3');
const Utils = require('./utils');


exports.getData = {
    handler: function(request, reply) {

        var sequelize = request.server.plugins.sequelize.db.sequelize;
        var userId = request.auth.credentials.id;
        var queryString = Queries.contact(userId);

        sequelize.query(queryString, {
            type: sequelize.QueryTypes.SELECT
        }).then(function(rows) {

            var contactResponse = D3.values(rows[0]);
            var regionsResponse = D3.values(rows[1]);

            var subjectLine = Utils.buildSubject(contactResponse[0].subject, regionsResponse);
            var data = {
                'phone': contactResponse[0].phone,
                'email': contactResponse[0].email,
                'subject': subjectLine
            };

            reply(data);
        });
    }
};

{'fraction_non_alphanumeric': 0.13308391234633885, 'fraction_numerical': 0.009620523784072688, 'mean_word_length': 2.2, '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': '1765731', 'n_tokens_mistral': 526, 'n_tokens_neox': 513, 'n_words': 94}