mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-05-09 15:26:40 +02:00
feat(dataLogs): show user score change history
This commit is contained in:
@@ -9,6 +9,7 @@ var path = require('path'),
|
||||
errorHandler = require(path.resolve('./modules/core/server/controllers/errors.server.controller')),
|
||||
UserDaysLog = mongoose.model('UserDaysLog'),
|
||||
UserMonthsLog = mongoose.model('UserMonthsLog'),
|
||||
ScoreLog = mongoose.model('ScoreLog'),
|
||||
objectId = require('mongodb').ObjectId,
|
||||
async = require('async');
|
||||
|
||||
@@ -36,3 +37,15 @@ exports.getUserMonthsLogs = function (req, res) {
|
||||
res.json(logs);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* List of getUserScoreLogs
|
||||
*/
|
||||
exports.getUserScoreLogs = function (req, res) {
|
||||
ScoreLog.find({
|
||||
user: objectId(req.params.userId)
|
||||
}).sort('-createdAt')
|
||||
.exec(function (err, logs) {
|
||||
res.json(logs);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user