This was due to a version mismatch. I was trying to use the database with a previous version of NodeBB by mistake. I'm marking this as solved
A
asdrubalivan
@asdrubalivan
Posts
-
[SOLVED] Getting a WRONGTYPE Operation against a key holding the wrong kind of value -
[Solved] Help with hook on getting recent topic topicsNo. I just tried and it works @PitaJ. I just changed the hook and it worked. Thank you so much! This is now solved
-
[Solved] Help with hook on getting recent topic topicsHello everyone! I have the following issue while developing a new theme for NodeBB.
We are adding upvote/downvote capability to topics from the topics list like in the following image
In order to add voting/downvoting to theme topics from the categories list like the following we added this method
library.getCategoryHook = async function(data) { const topics = data.topics; const uid = data.uid; const promises = topics.map(async (topic) => { const hasVoted = await posts.hasVoted(topic.mainPid, uid); return { ...topic, upvoted: hasVoted.upvoted, downvoted: hasVoted.downvoted, enableVoting: uid !== 0 && data.uid !== topic.uid } }); data.topics = await Promise.all(promises); return data; }
This is called using the hook
filter:category.topics.get
and it works for the topics list but if I try to go to the recent topics view, this hook is not called. Other possibility would be to load the information on page enter but I'm not sure how to do that, any suggestions?Thanks for any help