File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
lib/content_management/bloc/create_headline Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -135,18 +135,27 @@ class CreateHeadlineBloc
135
135
136
136
emit (state.copyWith (status: CreateHeadlineStatus .submitting));
137
137
try {
138
+ final now = DateTime .now ();
138
139
final newHeadline = Headline (
139
140
title: state.title,
140
141
description: state.description.isNotEmpty ? state.description : null ,
141
142
url: state.url.isNotEmpty ? state.url : null ,
142
143
imageUrl: state.imageUrl.isNotEmpty ? state.imageUrl : null ,
143
144
source: state.source,
145
+ publishedAt: now,
146
+ createdAt: now,
147
+ updatedAt: now,
144
148
category: state.category,
145
149
status: state.contentStatus,
146
150
);
147
151
148
152
await _headlinesRepository.create (item: newHeadline);
149
- emit (state.copyWith (status: CreateHeadlineStatus .success));
153
+ emit (
154
+ state.copyWith (
155
+ status: CreateHeadlineStatus .success,
156
+ createdHeadline: newHeadline,
157
+ ),
158
+ );
150
159
} on HtHttpException catch (e) {
151
160
emit (
152
161
state.copyWith (
You can’t perform that action at this time.
0 commit comments