Skip to content

Commit 948724c

Browse files
committed
feat(content_management): Remove Optimistic "Add" Logic
1 parent ac15f43 commit 948724c

File tree

1 file changed

+24
-66
lines changed

1 file changed

+24
-66
lines changed

lib/content_management/bloc/content_management_event.dart

Lines changed: 24 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@ final class LoadHeadlinesRequested extends ContentManagementEvent {
3838
List<Object?> get props => [startAfterId, limit];
3939
}
4040

41-
/// {@template headline_added}
42-
/// Event to add a new headline to the local state.
41+
/// {@template delete_headline_requested}
42+
/// Event to request deletion of a headline.
4343
/// {@endtemplate}
44-
final class HeadlineAdded extends ContentManagementEvent {
45-
/// {@macro headline_added}
46-
const HeadlineAdded(this.headline);
44+
final class DeleteHeadlineRequested extends ContentManagementEvent {
45+
/// {@macro delete_headline_requested}
46+
const DeleteHeadlineRequested(this.id);
4747

48-
/// The headline that was added.
49-
final Headline headline;
48+
/// The ID of the headline to delete.
49+
final String id;
5050

5151
@override
52-
List<Object?> get props => [headline];
52+
List<Object?> get props => [id];
5353
}
5454

5555
/// {@template headline_updated}
@@ -66,20 +66,6 @@ final class HeadlineUpdated extends ContentManagementEvent {
6666
List<Object?> get props => [headline];
6767
}
6868

69-
/// {@template delete_headline_requested}
70-
/// Event to request deletion of a headline.
71-
/// {@endtemplate}
72-
final class DeleteHeadlineRequested extends ContentManagementEvent {
73-
/// {@macro delete_headline_requested}
74-
const DeleteHeadlineRequested(this.id);
75-
76-
/// The ID of the headline to delete.
77-
final String id;
78-
79-
@override
80-
List<Object?> get props => [id];
81-
}
82-
8369
/// {@template load_categories_requested}
8470
/// Event to request loading of categories.
8571
/// {@endtemplate}
@@ -97,18 +83,18 @@ final class LoadCategoriesRequested extends ContentManagementEvent {
9783
List<Object?> get props => [startAfterId, limit];
9884
}
9985

100-
/// {@template category_added}
101-
/// Event to add a new category to the local state.
86+
/// {@template delete_category_requested}
87+
/// Event to request deletion of a category.
10288
/// {@endtemplate}
103-
final class CategoryAdded extends ContentManagementEvent {
104-
/// {@macro category_added}
105-
const CategoryAdded(this.category);
89+
final class DeleteCategoryRequested extends ContentManagementEvent {
90+
/// {@macro delete_category_requested}
91+
const DeleteCategoryRequested(this.id);
10692

107-
/// The category that was added.
108-
final Category category;
93+
/// The ID of the category to delete.
94+
final String id;
10995

11096
@override
111-
List<Object?> get props => [category];
97+
List<Object?> get props => [id];
11298
}
11399

114100
/// {@template category_updated}
@@ -125,20 +111,6 @@ final class CategoryUpdated extends ContentManagementEvent {
125111
List<Object?> get props => [category];
126112
}
127113

128-
/// {@template delete_category_requested}
129-
/// Event to request deletion of a category.
130-
/// {@endtemplate}
131-
final class DeleteCategoryRequested extends ContentManagementEvent {
132-
/// {@macro delete_category_requested}
133-
const DeleteCategoryRequested(this.id);
134-
135-
/// The ID of the category to delete.
136-
final String id;
137-
138-
@override
139-
List<Object?> get props => [id];
140-
}
141-
142114
/// {@template load_sources_requested}
143115
/// Event to request loading of sources.
144116
/// {@endtemplate}
@@ -156,18 +128,18 @@ final class LoadSourcesRequested extends ContentManagementEvent {
156128
List<Object?> get props => [startAfterId, limit];
157129
}
158130

159-
/// {@template source_added}
160-
/// Event to add a new source to the local state.
131+
/// {@template delete_source_requested}
132+
/// Event to request deletion of a source.
161133
/// {@endtemplate}
162-
final class SourceAdded extends ContentManagementEvent {
163-
/// {@macro source_added}
164-
const SourceAdded(this.source);
134+
final class DeleteSourceRequested extends ContentManagementEvent {
135+
/// {@macro delete_source_requested}
136+
const DeleteSourceRequested(this.id);
165137

166-
/// The source that was added.
167-
final Source source;
138+
/// The ID of the source to delete.
139+
final String id;
168140

169141
@override
170-
List<Object?> get props => [source];
142+
List<Object?> get props => [id];
171143
}
172144

173145
/// {@template source_updated}
@@ -183,17 +155,3 @@ final class SourceUpdated extends ContentManagementEvent {
183155
@override
184156
List<Object?> get props => [source];
185157
}
186-
187-
/// {@template delete_source_requested}
188-
/// Event to request deletion of a source.
189-
/// {@endtemplate}
190-
final class DeleteSourceRequested extends ContentManagementEvent {
191-
/// {@macro delete_source_requested}
192-
const DeleteSourceRequested(this.id);
193-
194-
/// The ID of the source to delete.
195-
final String id;
196-
197-
@override
198-
List<Object?> get props => [id];
199-
}

0 commit comments

Comments
 (0)