feat: Implement automatic updated_at timestamp management in BaseModel and update BaseRepository to reflect changes
This commit is contained in:
@@ -114,6 +114,7 @@ class BaseRepository[ModelType]:
|
||||
for field, value in update_data.items():
|
||||
setattr(entity, field, value)
|
||||
|
||||
# The updated_at timestamp will be automatically set by the SQLAlchemy event listener
|
||||
self.session.add(entity)
|
||||
await self.session.commit()
|
||||
await self.session.refresh(entity)
|
||||
|
||||
Reference in New Issue
Block a user