Skip to content

Commit 229919a

Browse files
committed
feat: modified the _onSubmitted method in edit_category_bloc.dart. When a category is successfully updated, I'll emit the updatedCategory object along with the success status. This makes the updated item available in the BLoC's state, which is crucial for the UI to perform a local update on the main content list.
1 parent cd02fb8 commit 229919a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/content_management/bloc/edit_category/edit_category_bloc.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,12 @@ class EditCategoryBloc extends Bloc<EditCategoryEvent, EditCategoryState> {
142142
id: _categoryId,
143143
item: updatedCategory,
144144
);
145-
emit(state.copyWith(status: EditCategoryStatus.success));
145+
emit(
146+
state.copyWith(
147+
status: EditCategoryStatus.success,
148+
updatedCategory: updatedCategory,
149+
),
150+
);
146151
} on HtHttpException catch (e) {
147152
emit(
148153
state.copyWith(

0 commit comments

Comments
 (0)