feat: Enhance apple categorization logic and improve bulk category update feedback
Test Suite / test (24.15.0) (push) Has been cancelled

This commit is contained in:
Nils-Johan Gynther
2026-05-11 10:31:57 +02:00
parent 06056c6182
commit 56050a896b
4 changed files with 81 additions and 7 deletions
@@ -173,9 +173,6 @@ class AdminRepository {
// ── Produkter ──────────────────────────────────────────────────────────────
Future<List<AdminProduct>> listProducts() =>
_getList(ProductApiPaths.mine, AdminProduct.fromJson);
Future<List<AdminProduct>> listGlobalProducts() =>
_getList(ProductApiPaths.list, AdminProduct.fromJson, requiresAuth: false);
Future<List<PendingProduct>> listPrivateProducts() =>
@@ -244,8 +241,15 @@ class AdminRepository {
parse: (d) => d as Map<String, dynamic>,
);
Future<void> bulkSetCategory(List<int> ids, {required int? categoryId}) =>
_postVoid(ProductApiPaths.bulkUpdate, {'ids': ids, 'categoryId': categoryId});
Future<int> bulkSetCategory(List<int> ids, {required int? categoryId}) =>
_post<int>(
ProductApiPaths.bulkUpdate,
body: {'ids': ids, 'categoryId': categoryId},
parse: (d) {
final map = Map<String, dynamic>.from(d as Map);
return (map['updated'] as num?)?.toInt() ?? 0;
},
);
Future<void> mergeProducts({
required int sourceProductId,