Skip to content

Node.js based forum software built for the modern web

fix: account/categories

Barış Soner Uşaklı7a0f607434bf
diff --git a/src/controllers/accounts/categories.js b/src/controllers/accounts/categories.js
index d3feaece25..a1253ef57e 100644
--- a/src/controllers/accounts/categories.js
+++ b/src/controllers/accounts/categories.js
@@ -13,7 +13,7 @@ categoriesController.get = async function (req, res, next) {
}
const [states, categoriesData] = await Promise.all([
user.getCategoryWatchState(userData.uid),
- categories.buildForSelect(userData.uid, 'find', ['descriptionParsed', 'depth']),
+ categories.buildForSelect(userData.uid, 'find', ['descriptionParsed', 'depth', 'slug']),
]);
categoriesData.forEach(function (category) {
diff --git a/src/socket.io/categories.js b/src/socket.io/categories.js
index df4e9b9a55..2f6c69a6e4 100644
--- a/src/socket.io/categories.js
+++ b/src/socket.io/categories.js
@@ -105,17 +105,17 @@ SocketCategories.setWatchState = async function (socket, data) {
if (!data || !data.cid || !data.state) {
throw new Error('[[error:invalid-data]]');
}
- await ignoreOrWatch(async function (uid, cid) {
+ return await ignoreOrWatch(async function (uid, cid) {
await user.setCategoryWatchState(uid, cid, categories.watchStates[data.state]);
}, socket, data);
};
SocketCategories.watch = async function (socket, data) {
- await ignoreOrWatch(user.watchCategory, socket, data);
+ return await ignoreOrWatch(user.watchCategory, socket, data);
};
SocketCategories.ignore = async function (socket, data) {
- await ignoreOrWatch(user.ignoreCategory, socket, data);
+ return await ignoreOrWatch(user.ignoreCategory, socket, data);
};
async function ignoreOrWatch(fn, socket, data) {