fixes-inbox-topics-authors
This commit is contained in:
parent
5c056525ed
commit
e16265a0c3
|
@ -74,7 +74,7 @@ async def add_user_to_chat(user_slug, chat_id, chat=None):
|
|||
await redis.execute("SET", f"chats/{chat_id}", json.dumps(chat))
|
||||
|
||||
|
||||
@mutation.query("inviteChat")
|
||||
@mutation.field("inviteChat")
|
||||
async def invite_to_chat(_, info, invited, chat_id):
|
||||
user = info.context["request"].user
|
||||
chat = await redis.execute("GET", f"chats/{chat_id}")
|
||||
|
|
|
@ -130,6 +130,7 @@ async def shouts_by_authors(_, _info, slugs, offset, limit):
|
|||
for a in s.authors:
|
||||
a.caption = await ShoutAuthorStorage.get_author_caption(s.slug, a.slug)
|
||||
shouts_prepared.append(s)
|
||||
shouts_prepared = list(set(shouts_prepared))
|
||||
shouts_prepared.sort(key=lambda s: s.publishedAt, reverse=True)
|
||||
return shouts_prepared[offset : offset + limit]
|
||||
|
||||
|
@ -146,6 +147,7 @@ async def shouts_by_topics(_, _info, slugs, offset, limit):
|
|||
for a in s.authors:
|
||||
a.caption = await ShoutAuthorStorage.get_author_caption(s.slug, a.slug)
|
||||
shouts_prepared.append(s)
|
||||
shouts_prepared = list(set(shouts_prepared))
|
||||
shouts_prepared.sort(key=lambda s: s.publishedAt, reverse=True)
|
||||
return shouts_prepared[offset : offset + limit]
|
||||
|
||||
|
|
|
@ -146,6 +146,7 @@ enum FollowingEntity {
|
|||
type Mutation {
|
||||
# inbox
|
||||
createChat(description: String): CreateChatResult!
|
||||
inviteChat(chatId: String!, userslug: String!): Result!
|
||||
createMessage(chatId: String!, body: String!, replyTo: Int): MessageResult!
|
||||
updateMessage(chatId: String!, id: Int!, body: String!): MessageResult!
|
||||
deleteMessage(chatId: String!, id: Int!): Result!
|
||||
|
@ -210,7 +211,6 @@ type Query {
|
|||
myChats: [ChatResult]!
|
||||
enterChat(chatId: String!): ChatResult!
|
||||
loadChat(chatId: String!, size: Int!, page: Int!): [Message]!
|
||||
inviteChat(chatId: String!, userslug: String!): Result!
|
||||
|
||||
# auth
|
||||
isEmailUsed(email: String!): Boolean!
|
||||
|
@ -503,7 +503,7 @@ type Chat {
|
|||
createdAt: DateTime!
|
||||
createdBy: User!
|
||||
updatedAt: DateTime!
|
||||
title: string
|
||||
title: String
|
||||
description: String
|
||||
users: [User]!
|
||||
messages: [Message]
|
||||
|
|
Loading…
Reference in New Issue
Block a user