From ff8a443e424baed772854c6ff6a50b5e2d160994 Mon Sep 17 00:00:00 2001 From: dal Date: Wed, 19 Mar 2025 14:03:59 -0600 Subject: [PATCH] fixed the created at and the ordering on the get --- api/libs/handlers/src/chats/get_chat_handler.rs | 3 ++- api/libs/handlers/src/chats/post_chat_handler.rs | 3 +++ api/libs/handlers/src/messages/types.rs | 7 ++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/api/libs/handlers/src/chats/get_chat_handler.rs b/api/libs/handlers/src/chats/get_chat_handler.rs index 1e31a8c9f..39668cb18 100644 --- a/api/libs/handlers/src/chats/get_chat_handler.rs +++ b/api/libs/handlers/src/chats/get_chat_handler.rs @@ -82,7 +82,7 @@ pub async fn get_chat_handler(chat_id: &Uuid, user_id: &Uuid) -> Result Result, #[serde(default)] pub reasoning_messages: HashMap, - pub created_at: String, + pub created_at: chrono::DateTime, pub final_reasoning_message: Option, } @@ -46,7 +46,7 @@ impl ChatMessage { response_messages: HashMap::new(), reasoning_message_ids: Vec::new(), reasoning_messages: HashMap::new(), - created_at: Utc::now().to_rfc3339(), + created_at: Utc::now(), final_reasoning_message: None, } } @@ -57,6 +57,7 @@ impl ChatMessage { response_messages: Vec, reasoning_messages: Vec, final_reasoning_message: Option, + created_at: chrono::DateTime, ) -> Self { let response_message_ids: Vec = response_messages .iter() @@ -91,7 +92,7 @@ impl ChatMessage { response_messages: response_messages_map, reasoning_message_ids, reasoning_messages: reasoning_messages_map, - created_at: Utc::now().to_rfc3339(), + created_at, final_reasoning_message, } }