feat(child): auto create parent-child conversations
This commit is contained in:
@@ -26,6 +26,7 @@ class ChildDAO(BaseDAO):
|
||||
child_name: str,
|
||||
child_gender: int = 2,
|
||||
child_birthday: Optional[date] = None,
|
||||
auto_commit: bool = True,
|
||||
) -> int:
|
||||
result = self.db.execute(
|
||||
text(
|
||||
@@ -38,7 +39,8 @@ class ChildDAO(BaseDAO):
|
||||
)
|
||||
child_id = inserted_primary_key(result)
|
||||
self._create_relation(user_id, child_id)
|
||||
self.commit()
|
||||
if auto_commit:
|
||||
self.commit()
|
||||
return child_id
|
||||
|
||||
def get_by_id(self, child_id: int) -> Optional[Mapping]:
|
||||
|
||||
Reference in New Issue
Block a user