chore: update logs (#643)

This commit is contained in:
Nathan.fooo 2024-06-23 15:40:26 +08:00 committed by GitHub
parent e33ef45d05
commit 72affd99e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,5 @@
use reqwest::Method;
use tracing::instrument;
use tracing::{instrument, trace};
use client_api_entity::AFWorkspaceSettings;
use shared_entity::response::{AppResponse, AppResponseError};
@ -35,6 +35,7 @@ impl Client {
workspace_id: T,
changes: &AFWorkspaceSettingsChange,
) -> Result<AFWorkspaceSettings, AppResponseError> {
trace!("workspace settings: {:?}", changes);
let url = format!(
"{}/api/workspace/{}/settings",
self.base_url,

View File

@ -529,7 +529,7 @@ impl Default for AFWorkspaceSettings {
}
}
#[derive(Default, Serialize, Deserialize)]
#[derive(Default, Serialize, Deserialize, Debug)]
pub struct AFWorkspaceSettingsChange {
#[serde(skip_serializing_if = "Option::is_none")]
pub disable_search_indexing: Option<bool>,

View File

@ -11,7 +11,7 @@ use sqlx::types::uuid;
use tokio::time::Instant;
use tokio_stream::StreamExt;
use tokio_tungstenite::tungstenite::Message;
use tracing::{error, event, instrument};
use tracing::{error, event, instrument, trace};
use uuid::Uuid;
use validator::Validate;
@ -326,13 +326,15 @@ async fn post_workspace_settings_handler(
workspace_id: web::Path<Uuid>,
data: Json<AFWorkspaceSettingsChange>,
) -> Result<JsonAppResponse<AFWorkspaceSettings>> {
let data = data.into_inner();
trace!("workspace settings: {:?}", data);
let uid = state.user_cache.get_user_uid(&user_uuid).await?;
let settings = workspace::ops::update_workspace_settings(
&state.pg_pool,
&state.workspace_access_control,
&workspace_id,
&uid,
data.into_inner(),
data,
)
.await?;
Ok(AppResponse::Ok().with_data(settings).into())