<commit_before>'use strict';
var pg = require('pg');
var conString = 'postgres://postgres:1234@localhost/postgres';
//May need to delete the stuff below
//var express = require('express');
//var util = require('util');
//var app = express();
//var multer = require('multer');
//app.use(multer({dest:'./uploads/'}));
//var fs = require('fs');

/**
 * Get tree data for a single tree (profile view)
 */
exports.getTreeData = function(req, res) {
  var treeid = req.params.treeId;
  pg.connect(conString, function(err, client, done) {
    var selectMessages = 'SELECT tree.name, tree.treeid, q.qspecies, tree.plantdate, l.latitude, l.longitude, image.imageurl, image.imagewidth, image.imageheight, image.imagetype from qspecies q JOIN tree ON (q.qspeciesid = tree.qspeciesid) JOIN "location" l ON (l.locationid = tree.locationid) JOIN image ON (q.qspeciesid = image.qspeciesid) WHERE treeid = $1;';
    client.query(selectMessages, [treeid], function(error, results) {
      done();
      if (error) {
        console.log(error, 'THERE WAS AN ERROR');
      }else{
        res.json(results.rows[0]);
      }
    });
  });
};
<commit_msg>Add message loading on user profile page as well as image upload capability. Load user messages on tree profile page  1. add getUserMessages to Articles controller  2. add loadUserImage to Articles controller  3. add UserImage factory and GetUserMessages factory  4. add ng-file-upload module to handle file upload on angular side  5. add multer (node module) for file upload server side  6. update CSS on user profile page  7. update getMessagesForUsers in articles/server/controllers/articles to return all fields from message table<commit_after>'use strict';
var pg = require('pg');
var conString = 'postgres://postgres:1234@localhost/postgres';


/**
 * Get tree data for a single tree (profile view)
 */
exports.getTreeData = function(req, res) {
  var treeid = req.params.treeId;
  pg.connect(conString, function(err, client, done) {
    var selectMessages = 'SELECT tree.name, tree.treeid, q.qspecies, tree.plantdate, l.latitude, l.longitude, image.imageurl, image.imagewidth, image.imageheight, image.imagetype from qspecies q JOIN tree ON (q.qspeciesid = tree.qspeciesid) JOIN "location" l ON (l.locationid = tree.locationid) JOIN image ON (q.qspeciesid = image.qspeciesid) WHERE treeid = $1;';
    client.query(selectMessages, [treeid], function(error, results) {
      done();
      if (error) {
        console.log(error, 'THERE WAS AN ERROR');
      }else{
        res.json(results.rows[0]);
      }
    });
  });
};

{'fraction_non_alphanumeric': 0.13065522620904838, 'fraction_numerical': 0.0074102964118564745, 'mean_word_length': 3.951737451737452, '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': '2552037', 'n_tokens_mistral': 807, 'n_tokens_neox': 774, 'n_words': 253}