inbox-debug-6
This commit is contained in:
parent
a83ef022a3
commit
cccaf16817
|
@ -24,6 +24,7 @@ async def update_chat(_, info, chat_new: ChatUpdate):
|
||||||
:param chat_new: dict with chat data
|
:param chat_new: dict with chat data
|
||||||
:return: Result { error chat }
|
:return: Result { error chat }
|
||||||
"""
|
"""
|
||||||
|
logger.info("update_chat")
|
||||||
author_id = info.context["author_id"]
|
author_id = info.context["author_id"]
|
||||||
chat_id = chat_new["id"]
|
chat_id = chat_new["id"]
|
||||||
chat_str = await redis.execute("GET", f"chats/{chat_id}")
|
chat_str = await redis.execute("GET", f"chats/{chat_id}")
|
||||||
|
@ -52,6 +53,7 @@ async def update_chat(_, info, chat_new: ChatUpdate):
|
||||||
@mutation.field("create_chat")
|
@mutation.field("create_chat")
|
||||||
@login_required
|
@login_required
|
||||||
async def create_chat(_, info, title="", members=None):
|
async def create_chat(_, info, title="", members=None):
|
||||||
|
logger.info("create_chat")
|
||||||
members = members or []
|
members = members or []
|
||||||
author_id = info.context["author_id"]
|
author_id = info.context["author_id"]
|
||||||
chat: Chat
|
chat: Chat
|
||||||
|
@ -98,6 +100,7 @@ async def create_chat(_, info, title="", members=None):
|
||||||
@mutation.field("delete_chat")
|
@mutation.field("delete_chat")
|
||||||
@login_required
|
@login_required
|
||||||
async def delete_chat(_, info, chat_id: str):
|
async def delete_chat(_, info, chat_id: str):
|
||||||
|
logger.info("delete_chat")
|
||||||
author_id = info.context["author_id"]
|
author_id = info.context["author_id"]
|
||||||
chat_str = await redis.execute("GET", f"chats/{chat_id}")
|
chat_str = await redis.execute("GET", f"chats/{chat_id}")
|
||||||
if isinstance(chat_str, str):
|
if isinstance(chat_str, str):
|
||||||
|
|
|
@ -115,6 +115,7 @@ async def load_chats(_, info, limit: int = 50, offset: int = 0) -> Dict[str, Uni
|
||||||
@login_required
|
@login_required
|
||||||
async def load_messages_by(_, info, by, limit: int = 10, offset: int = 0):
|
async def load_messages_by(_, info, by, limit: int = 10, offset: int = 0):
|
||||||
"""load :limit messages of :chat_id with :offset"""
|
"""load :limit messages of :chat_id with :offset"""
|
||||||
|
logger.info("load_messages_by")
|
||||||
author_id = info.context["author_id"]
|
author_id = info.context["author_id"]
|
||||||
author_chats = await redis.execute("SMEMBERS", f"chats_by_author/{author_id}")
|
author_chats = await redis.execute("SMEMBERS", f"chats_by_author/{author_id}")
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user