mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2026-01-31 04:25:02 -06:00
fix: Make custom fields not nullable and default to empty array
This commit is contained in:
@@ -51,7 +51,7 @@ class DocumentModel extends Equatable {
|
|||||||
|
|
||||||
// Only present if full_perms=true
|
// Only present if full_perms=true
|
||||||
final Permissions? permissions;
|
final Permissions? permissions;
|
||||||
final Iterable<CustomFieldModel>? customFields;
|
final Iterable<CustomFieldModel> customFields;
|
||||||
|
|
||||||
const DocumentModel({
|
const DocumentModel({
|
||||||
required this.id,
|
required this.id,
|
||||||
@@ -71,7 +71,7 @@ class DocumentModel extends Equatable {
|
|||||||
this.owner,
|
this.owner,
|
||||||
this.userCanChange,
|
this.userCanChange,
|
||||||
this.permissions,
|
this.permissions,
|
||||||
this.customFields,
|
this.customFields = const [],
|
||||||
});
|
});
|
||||||
|
|
||||||
factory DocumentModel.fromJson(Map<String, dynamic> json) =>
|
factory DocumentModel.fromJson(Map<String, dynamic> json) =>
|
||||||
|
|||||||
@@ -14,5 +14,6 @@ class Permissions with _$Permissions {
|
|||||||
@HiveField(1) required UsersAndGroupsPermissions change,
|
@HiveField(1) required UsersAndGroupsPermissions change,
|
||||||
}) = _Permissions;
|
}) = _Permissions;
|
||||||
|
|
||||||
factory Permissions.fromJson(Map<String, dynamic> json) => _$PermissionsFromJson(json);
|
factory Permissions.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$PermissionsFromJson(json);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user