Lol. Why. Haha is the API thing driving you nuts.
No, yours is pretty clever, and I don’t have the time right now to figure out how to do all of this. The holidays is a bad time around here. Too much work! lol
Small update from my previous version, 1 less API call and found a better API call to get all docs categories without the need of the where formatter.
Much much better @patrick, i did not realise you could pass the parameter instead of the where clause, much cleaner solution. I scoured those API docs on discourse and never found any mention of something like that anywhere, so I have no clue where the heck you found mention of that.
Docs for the Discourse API are not that good, you can find them at https://docs.discourse.org/, but it is not complete and doesn’t mention how to get the sub categories. I did find the parameter by inspecting the calls made by the forum, it uses ember for the rendering and uses the same API calls using Ajax.
Thanks Patrick, the other strange thing I noted when working with the API was that when I did an API fetch and it pulled in hundreds of fields and i compared those against what the discourse docs were saying should be available, there were some missing, that when i manually typed them into Wappler did have data inside. I found it strange that they were unavailable in the initial fetch though. I assume that is something wrong in the discourse stuff though?
Sorry, last notable thing is that although the API in Wappler can take a dynamic URL using the dmx-bind:url it is not really an openly available thing to do, hope that makes sense.