schema-fix

This commit is contained in:
tonyrewin 2022-12-10 10:35:29 +03:00
parent feb184d8e8
commit 9331c09526
2 changed files with 3 additions and 2 deletions

View File

@ -30,9 +30,10 @@ async def create_message(_, info, chat: str, body: str, replyTo=None):
"id": message_id,
"author": auth.user_id,
"body": body,
"replyTo": replyTo,
"createdAt": int(datetime.now(tz=timezone.utc).timestamp()),
}
if replyTo:
new_message = int(replyTo)
chat['updatedAt'] = new_message['createdAt']
await redis.execute("SET", f"chats/{chat['id']}", json.dumps(chat))
print(f"[inbox] creating message {new_message}")

View File

@ -505,7 +505,7 @@ type Message {
body: String!
createdAt: Int!
id: Int!
replyTo: String
replyTo: Int
updatedAt: Int
seen: Boolean
}