getTopicIdsWithContent method

Future<Set<String>> getTopicIdsWithContent(
  1. String domainId
)

Return the set of topic IDs (within domainId) that have at least one content chunk. Used to hide content-less leaves from the topic tree.

Implementation

Future<Set<String>> getTopicIdsWithContent(String domainId) async {
  final response = await _client
      .from('content_chunks')
      .select('topic_id, topics!inner(domain_id)')
      .eq('topics.domain_id', domainId);
  return (response as List<dynamic>)
      .map((row) => row['topic_id'] as String)
      .toSet();
}