snake-case
All checks were successful
deploy / deploy (push) Successful in 1m17s

This commit is contained in:
Untone 2023-11-16 17:58:14 +03:00
parent 871f7e1d69
commit c22b560bcf
6 changed files with 20 additions and 20 deletions

View File

@ -13,7 +13,7 @@ type ChatMember {
slug: String!
name: String!
userpic: String
lastSeen: Int!
last_seen: Int!
online: Boolean
# invitedAt: DateTime
# invitedBy: String # user slug
@ -72,18 +72,18 @@ type Message {
author: Int!
chatId: String!
body: String!
createdAt: Int!
created_at: Int!
id: Int!
replyTo: Int
updatedAt: Int
updated_at: Int
seen: Boolean
}
type Chat {
id: String!
createdAt: Int!
createdBy: Int!
updatedAt: Int!
created_at: Int!
created_by: Int!
updated_at: Int!
title: String
description: String
users: [Int]

View File

@ -104,8 +104,8 @@ async def load_messages_by(_, info, by, limit: int = 10, offset: int = 0):
messages = await load_messages(by_chat, limit, offset)
return {
"messages": sorted(
[m for m in messages if m.get("createdAt")],
key=lambda m: m.get("createdAt"),
[m for m in messages if m.get("created_at")],
key=lambda m: m.get("created_at"),
),
"error": None,
}

View File

@ -67,7 +67,7 @@ async def search_in_chats(
if days_ago:
mmm = list(
filter(
lambda msg: int(datetime.now(tz=timezone.utc)) - int(msg["createdAt"])
lambda msg: int(datetime.now(tz=timezone.utc)) - int(msg["created_at"])
< int(timedelta(days=days_ago)),
mmm,
)

View File

@ -9,9 +9,9 @@ class Chat(TypedDict):
members: List[int]
admins: List[int]
title: str
updatedAt: Optional[int]
createdAt: int
createdBy: int
updated_at: Optional[int]
created_at: int
created_by: int
description: Optional[str]
@ -20,9 +20,9 @@ class ChatPayload(TypedDict):
members: List[int | ChatMember]
admins: List[int]
title: str
updatedAt: Optional[int]
createdAt: int
createdBy: int
updated_at: Optional[int]
created_at: int
created_by: int
description: Optional[str]
messages: Optional[List[Message]]
unread: Optional[List[int]]

View File

@ -6,5 +6,5 @@ class ChatMember(TypedDict):
slug: str
name: str
userpic: Optional[str]
lastSeen: int
last_seen: int
online: Optional[bool]

View File

@ -6,7 +6,7 @@ class Message(TypedDict):
chat: str
author: int
body: str
createdAt: int
replyTo: Optional[int]
createdAt: int
updatedAt: Optional[int]
created_at: int
reply_to: Optional[int]
created_at: int
updated_at: Optional[int]