Anzahl der Kommentare und/oder Likes pro Thema über API abrufen?

Was ist der effizienteste Weg, um über die API die Anzahl der Kommentare zu erhalten, die ein Thema erhalten hat (und möglicherweise die Anzahl der Likes, entweder für den ersten Beitrag oder für alle Beiträge zusammen)?

(Ich habe das noch nicht geprüft, aber ich vermute, es gibt einen Counter-Cache, der die Anzahl der Antworten usw. speichert? Ist es möglich, diese Daten über die API abzurufen, anstatt das gesamte Thema zu laden?)

If you fetch a topic via the api like:

http://localhost:3000/t/welcome-to-discourse/8.json

It will return lots of things, but 2 of the values are:

posts_count:	214
like_count:	2

posts_count is the total number of posts the topic has. like_count is the total number of likes across all posts on the topic.

8 „Gefällt mir“

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.