mirror of https://github.com/buster-so/buster.git
commit up update user
This commit is contained in:
parent
63eebb0039
commit
4730b78284
|
@ -42,8 +42,9 @@ pub struct Message {
|
||||||
pub request_message: String,
|
pub request_message: String,
|
||||||
pub response_messages: Value,
|
pub response_messages: Value,
|
||||||
pub reasoning: Value,
|
pub reasoning: Value,
|
||||||
pub final_reasoning_message: String,
|
|
||||||
pub title: String,
|
pub title: String,
|
||||||
|
pub raw_llm_messages: Value,
|
||||||
|
pub final_reasoning_message: String,
|
||||||
pub chat_id: Uuid,
|
pub chat_id: Uuid,
|
||||||
pub created_at: DateTime<Utc>,
|
pub created_at: DateTime<Utc>,
|
||||||
pub updated_at: DateTime<Utc>,
|
pub updated_at: DateTime<Utc>,
|
||||||
|
|
|
@ -320,6 +320,7 @@ diesel::table! {
|
||||||
response_messages -> Jsonb,
|
response_messages -> Jsonb,
|
||||||
reasoning -> Jsonb,
|
reasoning -> Jsonb,
|
||||||
title -> Text,
|
title -> Text,
|
||||||
|
raw_llm_messages -> Jsonb,
|
||||||
final_reasoning_message -> Text,
|
final_reasoning_message -> Text,
|
||||||
chat_id -> Uuid,
|
chat_id -> Uuid,
|
||||||
created_at -> Timestamptz,
|
created_at -> Timestamptz,
|
||||||
|
|
|
@ -261,6 +261,7 @@ pub async fn post_chat_handler(
|
||||||
reasoning: serde_json::to_value(&reasoning_messages)?,
|
reasoning: serde_json::to_value(&reasoning_messages)?,
|
||||||
final_reasoning_message,
|
final_reasoning_message,
|
||||||
title: title.title.clone().unwrap_or_default(),
|
title: title.title.clone().unwrap_or_default(),
|
||||||
|
raw_llm_messages: todo!(),
|
||||||
};
|
};
|
||||||
|
|
||||||
// Insert message into database
|
// Insert message into database
|
||||||
|
|
|
@ -11,6 +11,7 @@ CREATE TABLE messages (
|
||||||
response_messages JSONB NOT NULL,
|
response_messages JSONB NOT NULL,
|
||||||
reasoning JSONB NOT NULL,
|
reasoning JSONB NOT NULL,
|
||||||
title TEXT NOT NULL,
|
title TEXT NOT NULL,
|
||||||
|
raw_llm_messages JSONB NOT NULL,
|
||||||
final_reasoning_message TEXT NOT NULL,
|
final_reasoning_message TEXT NOT NULL,
|
||||||
chat_id UUID NOT NULL REFERENCES chats(id),
|
chat_id UUID NOT NULL REFERENCES chats(id),
|
||||||
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
|
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
|
||||||
|
|
|
@ -73,10 +73,6 @@ pub async fn update_user_handler(
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if &auth_user.id == user_id {
|
|
||||||
return Err(anyhow::anyhow!("Cannot update self"));
|
|
||||||
};
|
|
||||||
|
|
||||||
match is_user_workspace_admin_or_data_admin(auth_user, &user_organization_id).await {
|
match is_user_workspace_admin_or_data_admin(auth_user, &user_organization_id).await {
|
||||||
Ok(true) => (),
|
Ok(true) => (),
|
||||||
Ok(false) => return Err(anyhow::anyhow!("Insufficient permissions")),
|
Ok(false) => return Err(anyhow::anyhow!("Insufficient permissions")),
|
||||||
|
|
Loading…
Reference in New Issue