Skip to content

Commit 400af63

Browse files
committed
refactor(content): refresh categories list after creation
1 parent 8878dfc commit 400af63

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/content_management/view/create_category_page.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'package:go_router/go_router.dart';
44
import 'package:ht_dashboard/content_management/bloc/content_management_bloc.dart';
55
import 'package:ht_dashboard/content_management/bloc/create_category/create_category_bloc.dart';
66
import 'package:ht_dashboard/l10n/l10n.dart';
7+
import 'package:ht_dashboard/shared/constants/pagination_constants.dart';
78
import 'package:ht_dashboard/shared/shared.dart';
89
import 'package:ht_data_repository/ht_data_repository.dart';
910
import 'package:ht_shared/ht_shared.dart';
@@ -81,7 +82,8 @@ class _CreateCategoryViewState extends State<_CreateCategoryView> {
8182
SnackBar(content: Text(l10n.categoryCreatedSuccessfully)),
8283
);
8384
context.read<ContentManagementBloc>().add(
84-
CategoryAdded(state.createdCategory!),
85+
// Refresh the list to show the new category
86+
const LoadCategoriesRequested(limit: kDefaultRowsPerPage),
8587
);
8688
context.pop();
8789
}

0 commit comments

Comments
 (0)