how can I list topics in a category?

NodeBB Development

Suggested Topics

  • 0 Votes
    7 Posts

    As a result, I got such a script, maybe it will be useful to someone.

    const Theme = {} const user = require.main.require('./src/user') const privileges = require.main.require('./src/privileges') Theme.getUsersByCategory = async function(data) { const { templateData: { cid } } = data const allUserIds = await user.getUidsFromSet('users:joindate', 0, -1) const asyncFilter = async (arr, predicate) => { const results = await Promise.all( return arr.filter((element, index) => results[index]) } const availableUserIds = await asyncFilter(allUserIds, async (id) => { return await privileges.categories.can('read', cid, id) }) data.templateData.availableUsers = await user.getUsersData(availableUserIds) return data } module.exports = Theme
  • 0 Votes
    4 Posts

    Well this seemed to work for me -

    .categories>li .category-children .icon, .category>ul>li .category-children .icon

    Now on to control the layout of the sub categories !!!!! 🙂

  • 0 Votes
    1 Posts

    I have the write api plugin installed as well as the question and answer plugin. We are successfully creating topics and posts. Is it possible to create a topic as a question? I tried adding isQuestion (equals 1) to the POST body when creating the topic but it was ignored. Would the write-api have to be forked and updated to support the optional value of isQuestion? It seems clear in the question and answer plugin that it doesn't create/expose any write api of its own.

  • 0 Votes
    3 Posts

    @julian I have a timestamp and I need to schedule the topic at this timestamp. So suppose that I want schedule topic at 01/12/2017(only) how can I modify the code to schedule the topic at these date?

  • 0 Votes
    6 Posts

    @yariplus cool, got it , thanks ~!