<commit_before>var query = (year, month, day) => {
  return {
    where: {
      createdAt: {
        between: [year + '-' + month + '-' + day + ' 00:00:00', year + '-' + month + '-' + day + ' 23:59:59']
      }
    }
  }
}

module.exports = function(sequelize, User) {
  var Gratitude = require('./../journals/journeys/gratitude')(sequelize);
  var Outlook = require('./../journals/journeys/outlook')(sequelize);
  var Affirmation = require('./../journals/journeys/affirmation')(sequelize);
  var Amazing = require('./../journals/journeys/amazing')(sequelize);
  var Reflection = require('./../journals/journeys/reflection')(sequelize);

  var getEntriesOnDate = (req, res, next, userId, month, day, year) => {
    var localQuery = query(year, month, day);
    var results = []
    User.find({
      where: {
        id: userId
      }
    })
    .then(user => {
      user.getAffirmations(localQuery)
      .then((affirmation) => {
        results.push(affirmation)
        console.log('made it yo')
        user.getAmazings(localQuery)
        .then((amazing) => {
          results.push(amazing)
          user.getGratitudes(localQuery)
          .then((gratitude) => {
            results.push(gratitude)
            user.getOutlooks(localQuery)
            .then((outlook) => {
              results.push(outlook)
              user.getReflections(localQuery)
              .then(reflection => {
                results.push(reflection)
                res.send(results);
              })
            })<commit_msg>Server refactor, not working<commit_after>var query = (year, month, day) => {
  return {
    where: {
      createdAt: {
        between: [year + '-' + month + '-' + day + ' 00:00:00', year + '-' + month + '-' + day + ' 23:59:59']
      }
    }
  }
}

module.exports = function(sequelize, User) {
  var Gratitude = require('./../journals/journeys/gratitude')(sequelize);
  var Outlook = require('./../journals/journeys/outlook')(sequelize);
  var Affirmation = require('./../journals/journeys/affirmation')(sequelize);
  var Amazing = require('./../journals/journeys/amazing')(sequelize);
  var Reflection = require('./../journals/journeys/reflection')(sequelize);

  var getEntriesOnDate = (req, res, next, userId, month, day, year) => {
    var localQuery = query(year, month, day);
    var results = []
    User.find({
      where: {
        id: userId
      }
    })
    .then(user => {
      user.getAffirmations(localQuery)
      .then((affirmation) => {
        results.push(affirmation)
        user.getAmazings(localQuery)
        .then((amazing) => {
          results.push(amazing)
          user.getGratitudes(localQuery)
          .then((gratitude) => {
            results.push(gratitude)
            user.getOutlooks(localQuery)
            .then((outlook) => {
              results.push(outlook)
              user.getReflections(localQuery)
              .then(reflection => {
                results.push(reflection)
                res.send(results);
              })
            })
{'fraction_non_alphanumeric': 0.16142904399603045, 'fraction_numerical': 0.007939133311280185, 'mean_word_length': 2.1434511434511436, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '5890688', 'n_tokens_mistral': 974, 'n_tokens_neox': 931, 'n_words': 150}