refactor(receipt-import): streamline category tree loading and enhance error handling

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Nils-Johan Gynther
2026-05-03 15:47:35 +02:00
parent 046dad870f
commit 5864a6f111
3 changed files with 145 additions and 58 deletions
@@ -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 ────────────────────────────────────────────────────────────