a bunch of frontend layout adjustments, and fixed message duplication by adding uuids

This commit is contained in:
2025-12-28 22:50:16 +01:00
parent 59fd5b13b8
commit c0043dcc15
3 changed files with 9 additions and 5 deletions

View File

@@ -23,6 +23,7 @@ pub struct MessageRow {
#[derive(sqlx::FromRow, serde::Serialize, Debug, Clone)]
pub struct Message {
pub uuid: Uuid,
pub sender: String,
pub message_type: String,
pub content: String,
@@ -87,6 +88,7 @@ async fn list_messages(
let messages: Vec<Message> = messages
.into_iter()
.map(|m| Message {
uuid: uuid::Uuid::now_v7(),
sender: m.sender,
message_type: m.message_type,
content: m.content,
@@ -136,6 +138,7 @@ async fn create_message(
let sender_name = username_from_uuid(&db, claims.sub).await?;
let message = Message {
uuid: uuid::Uuid::now_v7(),
sender: sender_name,
message_type: payload.message_type,
content: payload.content,