create-msg-fix3

This commit is contained in:
Untone 2023-10-13 21:11:17 +03:00
parent 32fc9646a3
commit a891470527
2 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,7 @@ type Mutation {
updateChat(chat: ChatInput!): ChatResult! updateChat(chat: ChatInput!): ChatResult!
deleteChat(chatId: String!): ChatResult! deleteChat(chatId: String!): ChatResult!
createMessage(chatId: String!, body: String!, replyTo: Int): ChatResult! createMessage(chat: String!, body: String!, replyTo: Int): ChatResult!
updateMessage(chatId: String!, id: Int!, body: String!): ChatResult! updateMessage(chatId: String!, id: Int!, body: String!): ChatResult!
deleteMessage(chatId: String!, id: Int!): ChatResult! deleteMessage(chatId: String!, id: Int!): ChatResult!
markAsRead(chatId: String!, ids: [Int]!): ChatResult! markAsRead(chatId: String!, ids: [Int]!): ChatResult!

View File

@ -10,7 +10,7 @@ from services.schema import mutation
@mutation.field("createMessage") @mutation.field("createMessage")
@login_required @login_required
async def create_message(_, info, chatId: str, body: str, reply_to=None): async def create_message(_, info, chat: str, body: str, reply_to=None):
""" """
create message with create message with
:body for :body for
@ -19,7 +19,7 @@ async def create_message(_, info, chatId: str, body: str, reply_to=None):
""" """
author_id = info.context["author_id"] author_id = info.context["author_id"]
chat_data = await redis.execute("GET", f"chats/{chatId}") chat_data = await redis.execute("GET", f"chats/{chat}")
if not chat_data: if not chat_data:
return {"error": "chat is not exist"} return {"error": "chat is not exist"}
else: else: