feat: Add bulk edit options (WIP)

This commit is contained in:
Anton Stubenbord
2023-03-11 18:39:27 +01:00
parent c7b5298845
commit 81822f5897
8 changed files with 431 additions and 17 deletions

View File

@@ -48,3 +48,34 @@ class BulkModifyTagsAction extends BulkAction {
};
}
}
class BulkModifyLabelAction extends BulkAction {
final String _labelName;
final int? labelId;
BulkModifyLabelAction.correspondent(
super.documents, {
required this.labelId,
}) : _labelName = 'correspondent';
BulkModifyLabelAction.documentType(
super.documents, {
required this.labelId,
}) : _labelName = 'document_type';
BulkModifyLabelAction.storagePath(
super.documents, {
required this.labelId,
}) : _labelName = 'storage_path';
@override
Map<String, dynamic> toJson() {
return {
'documents': documentIds.toList(),
'method': 'set_$_labelName',
'parameters': {
_labelName: labelId,
}
};
}
}