|
|
@ -4,8 +4,6 @@ const categories = require('../categories');
|
|
|
|
const privileges = require('../privileges');
|
|
|
|
const privileges = require('../privileges');
|
|
|
|
const user = require('../user');
|
|
|
|
const user = require('../user');
|
|
|
|
const topics = require('../topics');
|
|
|
|
const topics = require('../topics');
|
|
|
|
const api = require('../api');
|
|
|
|
|
|
|
|
const sockets = require('.');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const SocketCategories = module.exports;
|
|
|
|
const SocketCategories = module.exports;
|
|
|
|
|
|
|
|
|
|
|
@ -149,12 +147,6 @@ SocketCategories.isModerator = async function (socket, cid) {
|
|
|
|
return await user.isModerator(socket.uid, cid);
|
|
|
|
return await user.isModerator(socket.uid, cid);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
SocketCategories.getCategory = async function (socket, cid) {
|
|
|
|
|
|
|
|
sockets.warnDeprecated(socket, 'GET /api/v3/categories/:cid');
|
|
|
|
|
|
|
|
return await api.categories.get(socket, { cid });
|
|
|
|
|
|
|
|
// return await apiController.getCategoryData(cid, socket.uid);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SocketCategories.loadMoreSubCategories = async function (socket, data) {
|
|
|
|
SocketCategories.loadMoreSubCategories = async function (socket, data) {
|
|
|
|
if (!data || !data.cid || !(parseInt(data.start, 10) > 0)) {
|
|
|
|
if (!data || !data.cid || !(parseInt(data.start, 10) > 0)) {
|
|
|
|
throw new Error('[[error:invalid-data]]');
|
|
|
|
throw new Error('[[error:invalid-data]]');
|
|
|
|