forked from mtusi2026/mtusi2026lab2
финальные evidence для lab2 + кэширование
This commit is contained in:
@@ -10,7 +10,6 @@ from ..db.models import Chat, ChatMember, User
|
||||
async def create_atomic(
|
||||
db: AsyncSession, title: str, member_ids: list[UUID]
|
||||
) -> Chat:
|
||||
# проверка всех участников
|
||||
found = (
|
||||
(await db.execute(select(User.id).where(User.id.in_(member_ids))))
|
||||
.scalars()
|
||||
@@ -22,7 +21,7 @@ async def create_atomic(
|
||||
|
||||
chat = Chat(title=title)
|
||||
db.add(chat)
|
||||
await db.flush() # получить chat.id
|
||||
await db.flush()
|
||||
|
||||
for uid in member_ids:
|
||||
db.add(ChatMember(chat_id=chat.id, user_id=uid))
|
||||
|
||||
Reference in New Issue
Block a user