This commit is contained in:
@@ -21,9 +21,7 @@ async def update_chat(_, info, chat_new: ChatUpdate):
|
||||
:param chat_new: dict with chat data
|
||||
:return: Result { error chat }
|
||||
"""
|
||||
user_id = info.context["user_id"]
|
||||
author = authors_by_user[user_id]
|
||||
author_id = author["id"]
|
||||
author_id = info.context["author_id"]
|
||||
chat_id = chat_new["id"]
|
||||
chat_str = await redis.execute("GET", f"chats/{chat_id}")
|
||||
if not chat_str:
|
||||
@@ -57,6 +55,7 @@ async def create_chat(_, info, title="", members=None):
|
||||
user_id = info.context["user_id"]
|
||||
author = authors_by_user[user_id]
|
||||
author_id = author["id"]
|
||||
chat = None
|
||||
if author_id:
|
||||
if author_id not in members:
|
||||
members.append(int(author_id))
|
||||
@@ -101,9 +100,7 @@ async def create_chat(_, info, title="", members=None):
|
||||
@mutation.field("delete_chat")
|
||||
@login_required
|
||||
async def delete_chat(_, info, chat_id: str):
|
||||
user_id = info.context["user_id"]
|
||||
author = authors_by_user[user_id]
|
||||
author_id = author["id"]
|
||||
author_id = info.context["author_id"]
|
||||
chat_str = await redis.execute("GET", f"chats/{chat_id}")
|
||||
if chat_str:
|
||||
chat: Chat = json.loads(chat_str)
|
||||
|
Reference in New Issue
Block a user