'use strict'

const redis = require('../../lib/redis')
  , C       = require('../../lib/constants')

exports.find = function* (login) {
  let key = C.HISTORY + ':' + login
    , evts = yield redis.lrange(key, 0, -1)

  return evts.map(JSON.parse)
}

exports.create = function* (data) {
  let key = C.HISTORY + ':' + data.login
  return yield redis.lpush(key, stringify(data))
}

function stringify(data) {
  return JSON.stringify(data);
}

@@ -432,8 +432,7 @@
 ata)
-;
 %0A%7D%0A

Remove unnecessary semicolom