mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-17 04:52:51 +01:00
17 lines
438 B
JavaScript
17 lines
438 B
JavaScript
'use strict';
|
|
|
|
const db = require('../database');
|
|
|
|
module.exports = function (User) {
|
|
User.getIgnoredTids = async function (uid, start, stop) {
|
|
return await db.getSortedSetRevRange(`uid:${uid}:ignored_tids`, start, stop);
|
|
};
|
|
|
|
User.addTopicIdToUser = async function (uid, tid, timestamp) {
|
|
await Promise.all([
|
|
db.sortedSetAdd(`uid:${uid}:topics`, timestamp, tid),
|
|
User.incrementUserFieldBy(uid, 'topiccount', 1),
|
|
]);
|
|
};
|
|
};
|