Skip to content

Commit 74bdfe3

Browse files
committed
refactor: Implement Timestamp Logic for Creation
1 parent 15fb076 commit 74bdfe3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/content_management/bloc/create_category/create_category_bloc.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,14 @@ class CreateCategoryBloc
7979

8080
emit(state.copyWith(status: CreateCategoryStatus.submitting));
8181
try {
82+
final now = DateTime.now();
8283
final newCategory = Category(
8384
name: state.name,
8485
description: state.description.isNotEmpty ? state.description : null,
8586
iconUrl: state.iconUrl.isNotEmpty ? state.iconUrl : null,
8687
status: state.contentStatus,
88+
createdAt: now,
89+
updatedAt: now,
8790
);
8891

8992
await _categoriesRepository.create(item: newCategory);

0 commit comments

Comments
 (0)