mirror of https://github.com/buster-so/buster.git
Rename chat name to title and filter out empty titles
Co-authored-by: dallin <dallin@buster.so>
This commit is contained in:
parent
d42fdd489d
commit
2cd3f0696f
|
@ -54,7 +54,7 @@ pub struct ListChatsResponse {
|
||||||
struct ChatWithUser {
|
struct ChatWithUser {
|
||||||
// Chat fields
|
// Chat fields
|
||||||
pub id: Uuid,
|
pub id: Uuid,
|
||||||
pub name: String,
|
pub title: String,
|
||||||
pub created_at: DateTime<Utc>,
|
pub created_at: DateTime<Utc>,
|
||||||
pub updated_at: DateTime<Utc>,
|
pub updated_at: DateTime<Utc>,
|
||||||
pub created_by: Uuid,
|
pub created_by: Uuid,
|
||||||
|
@ -105,6 +105,7 @@ pub async fn list_chats_handler(
|
||||||
let mut query = chats::table
|
let mut query = chats::table
|
||||||
.inner_join(users::table.on(chats::created_by.eq(users::id)))
|
.inner_join(users::table.on(chats::created_by.eq(users::id)))
|
||||||
.filter(chats::deleted_at.is_null())
|
.filter(chats::deleted_at.is_null())
|
||||||
|
.filter(chats::title.ne("")) // Filter out empty titles
|
||||||
.into_boxed();
|
.into_boxed();
|
||||||
|
|
||||||
// Add user filter if not admin view
|
// Add user filter if not admin view
|
||||||
|
@ -146,7 +147,7 @@ pub async fn list_chats_handler(
|
||||||
.map(|chat| {
|
.map(|chat| {
|
||||||
ChatListItem {
|
ChatListItem {
|
||||||
id: chat.id.to_string(),
|
id: chat.id.to_string(),
|
||||||
name: chat.name,
|
name: chat.title,
|
||||||
is_favorited: false, // TODO: Implement favorites feature
|
is_favorited: false, // TODO: Implement favorites feature
|
||||||
created_at: chat.created_at.to_rfc3339(),
|
created_at: chat.created_at.to_rfc3339(),
|
||||||
updated_at: chat.updated_at.to_rfc3339(),
|
updated_at: chat.updated_at.to_rfc3339(),
|
||||||
|
|
|
@ -78,6 +78,7 @@ pub async fn list_logs_handler(
|
||||||
.inner_join(users::table.on(chats::created_by.eq(users::id)))
|
.inner_join(users::table.on(chats::created_by.eq(users::id)))
|
||||||
.filter(chats::deleted_at.is_null())
|
.filter(chats::deleted_at.is_null())
|
||||||
.filter(chats::organization_id.eq(organization_id))
|
.filter(chats::organization_id.eq(organization_id))
|
||||||
|
.filter(chats::title.ne("")) // Filter out empty titles
|
||||||
.into_boxed();
|
.into_boxed();
|
||||||
|
|
||||||
// Calculate offset based on page number
|
// Calculate offset based on page number
|
||||||
|
|
Loading…
Reference in New Issue