• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

No topics from getCategoryById

Scheduled Pinned Locked Moved Plugin Development
3 Posts 2 Posters 1.3k Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • WarbleSyncW Offline
    WarbleSyncW Offline
    WarbleSync
    wrote on last edited by
    #1

    I'm using the following code to pull back a category by id. When I use the the api url in a browser topics are included but not when using this method. Am I missing a required piece of data?

    //get category by id
    Categories.getCategoryById({cid: category_id,uid: 0},function(err,res){
      if(err){
        console.log(err)
        cb(null, data)
      }
      category = res
      callback()
    })
    
    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #2

    You need to pass in more parameters

    Categories.getCategoryById({
      cid: category_id, 
      set: 'cid:' + category_id + ':tids', 
      reverse: false,
      start: 0,
      stop: 19,
      uid: 0
    }, callback);
    
    1 Reply Last reply
    0
  • WarbleSyncW Offline
    WarbleSyncW Offline
    WarbleSync
    wrote on last edited by
    #3

    Awesome ty so much 🙂
    I ended up making the call to Categories.getCategoryTopics() but I may switch back to the method you posted above 👍

    1 Reply Last reply
    0

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development