mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 10:06:13 +01:00
showing history state in post tools load
This commit is contained in:
@@ -8,6 +8,12 @@ var diff = require('diff');
|
||||
module.exports = function (Posts) {
|
||||
Posts.diffs = {};
|
||||
|
||||
Posts.diffs.exists = function (pid, callback) {
|
||||
db.sortedSetCard('post:' + pid + ':diffs', function (err, numDiffs) {
|
||||
return callback(err, numDiffs > 0);
|
||||
});
|
||||
};
|
||||
|
||||
Posts.diffs.list = function (pid, callback) {
|
||||
db.getSortedSetRangeWithScores('post:' + pid + ':diffs', 0, -1, function (err, diffs) {
|
||||
callback(err, diffs ? diffs.map(function (diffObj) {
|
||||
|
||||
Reference in New Issue
Block a user