Category Follow/Unfollow
-
I deleted a GPT generated spam post in the queue for this topic, but part of it was:
First, create a custom NodeBB plugin. You can use the NodeBB plugin generator to get started quickly. To create a custom plugin, you need to have some familiarity with Node.js and NodeBB's architecture.
Hey, where can I find this plugin generator
-
@Mikkel-Lindhard For reference, the new API calls for updating category watch state are now available.
-
Thanks for the update, @julian - I might be getting too old, but following the documentation, it does not seem to work on our latest deployment of 3.5.1.
Here is my Postman setup. Maybe you can spot my wrongdoings -
@Mikkel-Lindhard I think these api routes are on the develop branch and will become available in 3.6.0. https://github.com/NodeBB/NodeBB/blob/develop/src/socket.io/categories.js#L88
-
@baris thank you for pointing me at the solution.
I think it would be a good idea that the official API docs follows the latest release branch instead of dev -
Hi @Mikkel-Lindhard! You're right, it's a little confusing. I didn't really think about it because you might be the first to point it out
I believe https://try.nodebb.org runs latest
master
, so I will use that as the base instead. Currently it looks at the OpenAPI file for this site, which almost always runs latestdevelop
.The other issue is that the top of the docs always says "3.0.0", which isn't quite correct. It's hardcoded currently.
Edit: This is now done.
-
@julian, thanks for the update.
"The other issue is that the top of the docs always says "3.0.0", which isn't quite correct. It's hardcoded currently."
This will be the dot above the I to make it more correct; in this case, I assume, 3.5.1.I have deployed a version from the "develop" branch, which states 3.5.1 in the administration dashboard.
Shouldn't this also state something differently to make it differ from the production branches?I'm still getting a 404 error with the watch API endpoint in this case:
"https://nodebb.dangdi.life/api/v3/categories/2/watch"
with the body:
{
"uid": 2,
"state": "watching"
}Should I run a different branch?
-
@Mikkel-Lindhard how are you making the requests, the watch routes are definitely on the
develop
branch. https://github.com/NodeBB/NodeBB/blob/develop/src/routes/write/categories.js#L24-L25. You need to make aput
request to/api/v3/categories/2/watch
-
@baris Through Postman - I can share the request if you have the time; otherwise, here is a screenshot of the Postman configuration:
-
Yields 404 also.
Can I, in the administration Dashboard, see if I'm running on the "develop" branch?
From serverside, I can check with git status where it clearly states I'm running on that branch but from the dashboard. -
endpoints are present:
setupApiRoute(router, 'put', '/:cid/watch', [...middlewares, middleware.assert.category], controllers.write.categories.setWat> setupApiRoute(router, 'delete', '/:cid/watch', [...middlewares, middleware.assert.category], controllers.write.categories.set>
-
@baris I have it working - I just needed to use a user token that was not the master and add the _uid=0 to as param..
-
It was indeed not necessary to have the _uid.