This repository has been archived on 2026-06-02. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
FabledApp/lib/data/repositories/knowledge_repository.dart

34 lines
818 B
Dart

import '../api/knowledge_api.dart';
import '../models/knowledge_item.dart';
class KnowledgeRepository {
final KnowledgeApi _api;
const KnowledgeRepository(this._api);
Future<(List<int>, int)> fetchIds({
String? noteType,
List<String> tags = const [],
String sort = 'modified',
String? q,
int limit = 50,
int offset = 0,
}) =>
_api.fetchIds(
noteType: noteType,
tags: tags,
sort: sort,
q: q,
limit: limit,
offset: offset,
);
Future<List<KnowledgeItem>> fetchBatch(List<int> ids) =>
_api.fetchBatch(ids);
Future<Map<String, int>> fetchCounts({List<String> tags = const []}) =>
_api.fetchCounts(tags: tags);
Future<List<String>> fetchTags({String? noteType}) =>
_api.fetchTags(noteType: noteType);
}