create-msg-fix2
This commit is contained in:
parent
3959a36d8a
commit
32fc9646a3
|
@ -44,7 +44,7 @@ type Mutation {
|
||||||
updateChat(chat: ChatInput!): ChatResult!
|
updateChat(chat: ChatInput!): ChatResult!
|
||||||
deleteChat(chatId: String!): ChatResult!
|
deleteChat(chatId: String!): ChatResult!
|
||||||
|
|
||||||
createMessage(chat: String!, body: String!, replyTo: Int): ChatResult!
|
createMessage(chatId: 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!
|
||||||
|
|
|
@ -10,7 +10,7 @@ from services.schema import mutation
|
||||||
|
|
||||||
@mutation.field("createMessage")
|
@mutation.field("createMessage")
|
||||||
@login_required
|
@login_required
|
||||||
async def create_message(_, info, chat_id: str, body: str, reply_to=None):
|
async def create_message(_, info, chatId: 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, chat_id: 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/{chat_id}")
|
chat_data = await redis.execute("GET", f"chats/{chatId}")
|
||||||
if not chat_data:
|
if not chat_data:
|
||||||
return {"error": "chat is not exist"}
|
return {"error": "chat is not exist"}
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user