mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-10 06:07:57 -06:00
feat: Implement new tag form field
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'tags_query.dart';
|
||||
@@ -22,6 +23,16 @@ class AnyAssignedTagsQuery extends TagsQuery {
|
||||
@override
|
||||
List<Object?> get props => [tagIds];
|
||||
|
||||
AnyAssignedTagsQuery withRemoved(Iterable<int> ids) {
|
||||
return AnyAssignedTagsQuery(
|
||||
tagIds: tagIds.toSet().difference(ids.toSet()).toList(),
|
||||
);
|
||||
}
|
||||
|
||||
AnyAssignedTagsQuery withAdded(Iterable<int> ids) {
|
||||
return AnyAssignedTagsQuery(tagIds: [...tagIds, ...ids]);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() => _$AnyAssignedTagsQueryToJson(this);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user