Skip to content

Commit 690d35a

Browse files
committed
refactor(content_management): update the _onSubmitted method in edit_source_bloc.dart. When a source is successfully updated, I'll set the updatedAt timestamp and then emit the complete updatedSource object along with the success status. This makes the updated item available in the BLoC's state, which is the final piece required before we can move on to updating the main ContentManagementBloc.
1 parent 61dfa2b commit 690d35a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/content_management/bloc/edit_source/edit_source_bloc.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,16 @@ class EditSourceBloc extends Bloc<EditSourceEvent, EditSourceState> {
180180
language: state.language.isNotEmpty ? state.language : null,
181181
headquarters: state.headquarters,
182182
status: state.contentStatus,
183+
updatedAt: DateTime.now(),
183184
);
184185

185186
await _sourcesRepository.update(id: _sourceId, item: updatedSource);
186-
emit(state.copyWith(status: EditSourceStatus.success));
187+
emit(
188+
state.copyWith(
189+
status: EditSourceStatus.success,
190+
updatedSource: updatedSource,
191+
),
192+
);
187193
} on HtHttpException catch (e) {
188194
emit(
189195
state.copyWith(

0 commit comments

Comments
 (0)