var Boom = require('boom');
var User = require('../models/User');
var bookshelf = require('../db/bookshelf_init')
var Promise = require('bluebird');
var R = require('ramda');

module.exports = [
  {
    method: 'GET',
    path: '/users',
    handler: function (req, res) {
      User.fetchAll({columns: ['name']})
      .then(function (hashtags) {
        var serialized = hashtags.toJSON();
        return R.map(R.prop('name'), serialized);
      })
      .then(res)
    }
  },

  {
    method: 'GET',
    path: '/users/{id}',
    handler: function (req, res) {
      if (!req.params.id) {
        return res(Boom.badRequest('Valid user id required'));
      }
      User.where({id: req.params.id}).fetch({withRelated: 'badges'})
      .then(function (user) {
        return Promise.all([
          user.getHashtags(),
          bookshelf.knex('changesets')
          .select('*')
          .orderBy('created_at', 'desc')
          .where('user_id', req.params.id)
          .limit(1),
          bookshelf.knex('changesets')
          .select('created_at')
          .where('user_id', req.params.id),
        ])
        .then(function (results) {
          var hashtags = results[0]
          var latest = results[1];
          var edit_times = R.map(R.prop('created_at'), results[2]);

          var serialized = user.toJSON();
          serialized.latest = latest;
          serialized.edit_times = edit_times;
          serialized.hashtags = hashtags;
          return serialized;
        })
      })
      .then(res);
    }
  }
]
@@ -302,151 +302,20 @@
 : %5B'
+id', '
 name'%5D
-%7D)%0A      .then(function (hashtags) %7B%0A        var serialized = hashtags.toJSON();%0A        return R.map(R.prop('name'), serialized);%0A      
 %7D)%0A 

Add ids to each user in users route