Skip to content

Commit 60654ef

Browse files
committed
refactor(content_management): replace errorMessage with exception
- Changed `errorMessage` to `exception` in `EditHeadlineState`. - Updated `exception` type to `HtHttpException`. - Updated `props` list in `EditHeadlineState`.
1 parent 12ba1ad commit 60654ef

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

lib/content_management/bloc/edit_headline/edit_headline_state.dart

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class EditHeadlineState extends Equatable {
3434
this.topics = const [],
3535
this.countries = const [],
3636
this.contentStatus = ContentStatus.active,
37-
this.errorMessage,
37+
this.exception,
3838
this.updatedHeadline,
3939
});
4040

@@ -51,7 +51,7 @@ final class EditHeadlineState extends Equatable {
5151
final List<Topic> topics;
5252
final List<Country> countries;
5353
final ContentStatus contentStatus;
54-
final String? errorMessage;
54+
final HtHttpException? exception;
5555
final Headline? updatedHeadline;
5656

5757
/// Returns true if the form is valid and can be submitted.
@@ -78,7 +78,7 @@ final class EditHeadlineState extends Equatable {
7878
List<Topic>? topics,
7979
List<Country>? countries,
8080
ContentStatus? contentStatus,
81-
String? errorMessage,
81+
HtHttpException? exception,
8282
Headline? updatedHeadline,
8383
}) {
8484
return EditHeadlineState(
@@ -95,27 +95,27 @@ final class EditHeadlineState extends Equatable {
9595
topics: topics ?? this.topics,
9696
countries: countries ?? this.countries,
9797
contentStatus: contentStatus ?? this.contentStatus,
98-
errorMessage: errorMessage,
98+
exception: exception,
9999
updatedHeadline: updatedHeadline ?? this.updatedHeadline,
100100
);
101101
}
102102

103103
@override
104104
List<Object?> get props => [
105-
status,
106-
initialHeadline,
107-
title,
108-
excerpt,
109-
url,
110-
imageUrl,
111-
source,
112-
topic,
113-
eventCountry,
114-
sources,
115-
topics,
116-
countries,
117-
contentStatus,
118-
errorMessage,
119-
updatedHeadline,
120-
];
105+
status,
106+
initialHeadline,
107+
title,
108+
excerpt,
109+
url,
110+
imageUrl,
111+
source,
112+
topic,
113+
eventCountry,
114+
sources,
115+
topics,
116+
countries,
117+
contentStatus,
118+
exception,
119+
updatedHeadline,
120+
];
121121
}

0 commit comments

Comments
 (0)