refactor(receipt-import): streamline category tree loading and enhance error handling
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -234,14 +234,12 @@ class AdminRepository {
|
||||
|
||||
// ── Kategorier ─────────────────────────────────────────────────────────────
|
||||
|
||||
Future<List<AdminCategoryNode>> listCategoryTree() async {
|
||||
final token = await _token();
|
||||
final data = await guardedApiCall(
|
||||
_ref,
|
||||
() => _apiClient.getJson(CategoryApiPaths.tree, token: token),
|
||||
);
|
||||
return _parseList(data, AdminCategoryNode.fromJson);
|
||||
}
|
||||
Future<List<AdminCategoryNode>> listCategoryTree() =>
|
||||
_getList(
|
||||
CategoryApiPaths.tree,
|
||||
AdminCategoryNode.fromJson,
|
||||
requiresAuth: false,
|
||||
);
|
||||
|
||||
// ── AI-modeller ────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user