diff --git a/resolvers/chats.py b/resolvers/chats.py index 364be5a..529006c 100644 --- a/resolvers/chats.py +++ b/resolvers/chats.py @@ -68,7 +68,7 @@ async def create_chat(_, info, title="", members=None): return {"chat": chat, "error": "existed"} chat_id = str(uuid.uuid4()) - : Chat = { + chat: Chat = { "id": chat_id, "members": members, "title": title, diff --git a/resolvers/load.py b/resolvers/load.py index bd7b548..8ffe705 100644 --- a/resolvers/load.py +++ b/resolvers/load.py @@ -63,7 +63,7 @@ async def load_chats(_, info, limit: int = 50, offset: int = 0) -> Dict[str, Uni if len(cids) == 0: print(f"[resolvers.load] no chats for user with id={author_id}") r = await create_chat(None, info, members=[2]) # member with id = 2 is discours - print(f"[resolvers.load] created chat: {r['chat']}") + print(f"[resolvers.load] created chat: {r['chat_id']}") cids.append(r["chat"]["id"]) all_authors: List[ChatMember] = await get_all_authors() authors = {a["id"]: a for a in all_authors} diff --git a/services/presence.py b/services/presence.py index 416ff7f..125dfa8 100644 --- a/services/presence.py +++ b/services/presence.py @@ -5,7 +5,7 @@ from validators.chat import Message, ChatUpdate async def notify_message(message: Message, action="create"): - channel_name = f"message:{message["chat"]}" + channel_name = f"message:{message["chat_id"]}" data = {"payload": message, "action": action} try: await redis.publish(channel_name, json.dumps(data))