mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-05 05:25:49 +01:00
Tag follow (#12041)
* feat: tag follow * on tag delete remove it from following users * feat: on tag rename update user followed tags and move the * add new filter on /notifications * feat: openapi updates * chore: up themes * chore: up peace * refactor: remove unused title
This commit is contained in:
committed by
GitHub
parent
cf50b0fe49
commit
40d290c1a9
@@ -178,6 +178,7 @@ async function getCounts(userData, callerUID) {
|
||||
promises.bookmarks = db.sortedSetCard(`uid:${uid}:bookmarks`);
|
||||
promises.uploaded = db.sortedSetCard(`uid:${uid}:uploads`);
|
||||
promises.categoriesWatched = user.getWatchedCategories(uid);
|
||||
promises.tagsWatched = db.sortedSetCard(`uid:${uid}:followed_tags`);
|
||||
promises.blocks = user.getUserField(userData.uid, 'blocksCount');
|
||||
}
|
||||
const counts = await utils.promiseParallel(promises);
|
||||
|
||||
@@ -12,6 +12,7 @@ notificationsController.get = async function (req, res, next) {
|
||||
{ name: '[[notifications:all]]', filter: '' },
|
||||
{ name: '[[global:topics]]', filter: 'new-topic' },
|
||||
{ name: '[[notifications:replies]]', filter: 'new-reply' },
|
||||
{ name: '[[notifications:tags]]', filter: 'new-topic-with-tag' },
|
||||
{ name: '[[notifications:chat]]', filter: 'new-chat' },
|
||||
{ name: '[[notifications:group-chat]]', filter: 'new-group-chat' },
|
||||
{ name: '[[notifications:public-chat]]', filter: 'new-public-chat' },
|
||||
|
||||
25
src/controllers/accounts/tags.js
Normal file
25
src/controllers/accounts/tags.js
Normal file
@@ -0,0 +1,25 @@
|
||||
'use strict';
|
||||
|
||||
const db = require('../../database');
|
||||
const user = require('../../user');
|
||||
const helpers = require('../helpers');
|
||||
|
||||
const tagsController = module.exports;
|
||||
|
||||
tagsController.get = async function (req, res) {
|
||||
if (req.uid !== res.locals.uid) {
|
||||
return helpers.notAllowed(req, res);
|
||||
}
|
||||
const { username, userslug } = await user.getUserFields(res.locals.uid, ['username', 'userslug']);
|
||||
const tagData = await db.getSortedSetRange(`uid:${res.locals.uid}:followed_tags`, 0, -1);
|
||||
|
||||
const payload = {};
|
||||
payload.tags = tagData;
|
||||
payload.title = `[[pages:account/watched-tags, ${username}]]`;
|
||||
payload.breadcrumbs = helpers.buildBreadcrumbs([
|
||||
{ text: username, url: `/user/${userslug}` },
|
||||
{ text: '[[pages:tags]]' },
|
||||
]);
|
||||
|
||||
res.render('account/tags', payload);
|
||||
};
|
||||
Reference in New Issue
Block a user