chore(lint): clean up frontend and Rust lint issues
This commit is contained in:
@@ -20,22 +20,14 @@ impl MigrationTrait for Migration {
|
||||
.primary_key(),
|
||||
)
|
||||
.col(ColumnDef::new(ChatChannel::Name).string().not_null())
|
||||
.col(
|
||||
ColumnDef::new(ChatChannel::ChannelType)
|
||||
.string()
|
||||
.not_null(),
|
||||
)
|
||||
.col(ColumnDef::new(ChatChannel::ChannelType).string().not_null())
|
||||
.col(
|
||||
ColumnDef::new(ChatChannel::Enabled)
|
||||
.boolean()
|
||||
.not_null()
|
||||
.default(true),
|
||||
)
|
||||
.col(
|
||||
ColumnDef::new(ChatChannel::ConfigJson)
|
||||
.text()
|
||||
.not_null(),
|
||||
)
|
||||
.col(ColumnDef::new(ChatChannel::ConfigJson).text().not_null())
|
||||
.col(ColumnDef::new(ChatChannel::EventFilterJson).text().null())
|
||||
.col(
|
||||
ColumnDef::new(ChatChannel::DailyReportEnabled)
|
||||
@@ -43,11 +35,7 @@ impl MigrationTrait for Migration {
|
||||
.not_null()
|
||||
.default(false),
|
||||
)
|
||||
.col(
|
||||
ColumnDef::new(ChatChannel::DailyReportTime)
|
||||
.string()
|
||||
.null(),
|
||||
)
|
||||
.col(ColumnDef::new(ChatChannel::DailyReportTime).string().null())
|
||||
.col(
|
||||
ColumnDef::new(ChatChannel::CreatedAt)
|
||||
.timestamp_with_time_zone()
|
||||
@@ -138,11 +126,7 @@ impl MigrationTrait for Migration {
|
||||
|
||||
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
||||
manager
|
||||
.drop_table(
|
||||
Table::drop()
|
||||
.table(ChatChannelMessageLog::Table)
|
||||
.to_owned(),
|
||||
)
|
||||
.drop_table(Table::drop().table(ChatChannelMessageLog::Table).to_owned())
|
||||
.await?;
|
||||
manager
|
||||
.drop_table(Table::drop().table(ChatChannel::Table).to_owned())
|
||||
|
||||
@@ -10,7 +10,11 @@ impl MigrationTrait for Migration {
|
||||
.alter_table(
|
||||
Table::alter()
|
||||
.table(AgentSetting::Table)
|
||||
.add_column(ColumnDef::new(AgentSetting::ModelProviderId).integer().null())
|
||||
.add_column(
|
||||
ColumnDef::new(AgentSetting::ModelProviderId)
|
||||
.integer()
|
||||
.null(),
|
||||
)
|
||||
.to_owned(),
|
||||
)
|
||||
.await
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use chrono::Utc;
|
||||
use sea_orm::sea_query::OnConflict;
|
||||
use sea_orm::{ConnectionTrait, DatabaseConnection};
|
||||
use sea_orm::{ActiveValue::NotSet, ColumnTrait, EntityTrait, QueryFilter, Set};
|
||||
use sea_orm::{ConnectionTrait, DatabaseConnection};
|
||||
|
||||
use crate::db::entities::app_metadata;
|
||||
use crate::db::error::DbError;
|
||||
|
||||
@@ -207,8 +207,7 @@ pub async fn list_all(
|
||||
sort_by: Option<String>,
|
||||
status: Option<String>,
|
||||
) -> Result<Vec<DbConversationSummary>, DbError> {
|
||||
let mut query = conversation::Entity::find()
|
||||
.filter(conversation::Column::DeletedAt.is_null());
|
||||
let mut query = conversation::Entity::find().filter(conversation::Column::DeletedAt.is_null());
|
||||
|
||||
match folder_ids {
|
||||
Some(ids) if !ids.is_empty() => {
|
||||
|
||||
@@ -181,10 +181,7 @@ pub async fn list_all_folder_details(
|
||||
Ok(rows.into_iter().map(to_detail).collect())
|
||||
}
|
||||
|
||||
pub async fn reorder_folders(
|
||||
conn: &DatabaseConnection,
|
||||
ids: Vec<i32>,
|
||||
) -> Result<(), DbError> {
|
||||
pub async fn reorder_folders(conn: &DatabaseConnection, ids: Vec<i32>) -> Result<(), DbError> {
|
||||
if ids.is_empty() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
@@ -87,10 +87,7 @@ pub async fn delete_tabs_for_folder(
|
||||
conn: &DatabaseConnection,
|
||||
folder_id: i32,
|
||||
) -> Result<(), DbError> {
|
||||
let sql = format!(
|
||||
"DELETE FROM opened_tab WHERE folder_id = {}",
|
||||
folder_id
|
||||
);
|
||||
let sql = format!("DELETE FROM opened_tab WHERE folder_id = {}", folder_id);
|
||||
conn.execute(Statement::from_string(DbBackend::Sqlite, sql))
|
||||
.await?;
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user