fieldsfix
Some checks failed
deploy / deploy (push) Failing after 1m11s

This commit is contained in:
Untone 2023-11-16 18:28:16 +03:00
parent 33b1323630
commit 5c5cd4bf00
4 changed files with 7 additions and 7 deletions

View File

@ -70,7 +70,7 @@ type Query {
type Message { type Message {
author: Int! author: Int!
chatId: String! chat_id: String!
body: String! body: String!
created_at: Int! created_at: Int!
id: Int! id: Int!

View File

@ -68,7 +68,7 @@ async def create_chat(_, info, title="", members=None):
return {"chat": chat, "error": "existed"} return {"chat": chat, "error": "existed"}
chat_id = str(uuid.uuid4()) chat_id = str(uuid.uuid4())
chat: Chat = { : Chat = {
"id": chat_id, "id": chat_id,
"members": members, "members": members,
"title": title, "title": title,

View File

@ -32,7 +32,7 @@ async def create_message(_, info, chat_id: str, body: str, reply_to=None):
chat_id = chat_dict['id'] chat_id = chat_dict['id']
# Создание нового сообщения # Создание нового сообщения
new_message: Message = { new_message: Message = {
"chat": chat_id, "chat_id": chat_id,
"id": message_id, "id": message_id,
"author": author_id, "author": author_id,
"body": body, "body": body,
@ -70,7 +70,7 @@ async def create_message(_, info, chat_id: str, body: str, reply_to=None):
await redis.execute("LPUSH", f"chats/{chat_dict['id']}/unread/{member_id}", str(message_id)) await redis.execute("LPUSH", f"chats/{chat_dict['id']}/unread/{member_id}", str(message_id))
# Отправка уведомления о новом сообщении # Отправка уведомления о новом сообщении
new_message["chat"] = chat_id new_message["chat_id"] = chat_id
await notify_message(new_message, "create") await notify_message(new_message, "create")
return {"message": new_message, "error": None} return {"message": new_message, "error": None}
@ -100,7 +100,7 @@ async def update_message(_, info, chat_id: str, message_id: int, body: str):
# Отправка уведомления # Отправка уведомления
message["chat"] = chat_id message["chat_id"] = chat_id
await notify_message(message, "update") await notify_message(message, "update")
return {"message": message, "error": None} return {"message": message, "error": None}
@ -130,7 +130,7 @@ async def delete_message(_, info, chat_id: str, message_id: int):
for member_id in members: for member_id in members:
await redis.execute("LREM", f"chats/{chat_id}/unread/{member_id}", 0, str(message_id)) await redis.execute("LREM", f"chats/{chat_id}/unread/{member_id}", 0, str(message_id))
message["chat"] = chat_id message["chat_id"] = chat_id
await notify_message(message, "delete") await notify_message(message, "delete")
return {} return {}

View File

@ -3,7 +3,7 @@ from typing import TypedDict, Optional
class Message(TypedDict): class Message(TypedDict):
id: int id: int
chat: str chat_id: str
author: int author: int
body: str body: str
created_at: int created_at: int