feat: Implement caching for selectable products and enhance product filtering in admin panels
Test Suite / test (24.15.0) (push) Has been cancelled
Test Suite / test (24.15.0) (push) Has been cancelled
This commit is contained in:
@@ -3,6 +3,7 @@ class AdminProduct {
|
||||
final String name;
|
||||
final String? canonicalName;
|
||||
final String? normalizedName;
|
||||
final int? ownerId;
|
||||
final int? categoryId;
|
||||
final String? categoryPath;
|
||||
final bool? isActive;
|
||||
@@ -14,6 +15,7 @@ class AdminProduct {
|
||||
required this.name,
|
||||
this.canonicalName,
|
||||
this.normalizedName,
|
||||
this.ownerId,
|
||||
this.categoryId,
|
||||
this.categoryPath,
|
||||
this.isActive,
|
||||
@@ -43,6 +45,7 @@ class AdminProduct {
|
||||
name: (json['name'] ?? '').toString(),
|
||||
canonicalName: json['canonicalName']?.toString(),
|
||||
normalizedName: json['normalizedName']?.toString(),
|
||||
ownerId: ((json['owner'] as Map<String, dynamic>?)?['id'] as num?)?.toInt(),
|
||||
categoryId: (json['categoryId'] as num?)?.toInt(),
|
||||
categoryPath: names.isEmpty ? null : names.join(' > '),
|
||||
isActive: json['isActive'] as bool?,
|
||||
|
||||
@@ -3,6 +3,8 @@ class PendingProduct {
|
||||
final String name;
|
||||
final String? canonicalName;
|
||||
final DateTime? createdAt;
|
||||
final int? ownerId;
|
||||
final int? categoryId;
|
||||
final String? categoryPath;
|
||||
final String? ownerUsername;
|
||||
|
||||
@@ -11,6 +13,8 @@ class PendingProduct {
|
||||
required this.name,
|
||||
this.canonicalName,
|
||||
this.createdAt,
|
||||
this.ownerId,
|
||||
this.categoryId,
|
||||
this.categoryPath,
|
||||
this.ownerUsername,
|
||||
});
|
||||
@@ -45,6 +49,8 @@ class PendingProduct {
|
||||
createdAt: json['createdAt'] == null
|
||||
? null
|
||||
: DateTime.tryParse(json['createdAt'].toString()),
|
||||
ownerId: (owner is Map<String, dynamic>) ? (owner['id'] as num?)?.toInt() : null,
|
||||
categoryId: (json['categoryId'] as num?)?.toInt(),
|
||||
categoryPath: parts.isEmpty ? null : parts.join(' > '),
|
||||
ownerUsername: owner is Map<String, dynamic>
|
||||
? owner['username']?.toString()
|
||||
|
||||
Reference in New Issue
Block a user