From 12fec968fe4c363c93576b6f6dd7081455a7db92 Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Thu, 14 May 2026 14:05:22 +0800 Subject: [PATCH] fix(grid): remove WHERE and ORDER BY input placeholders --- crates/dbx-core/src/db/mongo_driver.rs | 3 ++- src/components/grid/DataGrid.vue | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/dbx-core/src/db/mongo_driver.rs b/crates/dbx-core/src/db/mongo_driver.rs index 4a39ace39..81023859a 100644 --- a/crates/dbx-core/src/db/mongo_driver.rs +++ b/crates/dbx-core/src/db/mongo_driver.rs @@ -78,7 +78,8 @@ pub async fn update_document( doc_json: &str, ) -> Result { let oid = mongodb::bson::oid::ObjectId::parse_str(id).map_err(|e| format!("Invalid ObjectId: {e}"))?; - let new_doc: Document = serde_json::from_str(doc_json).map_err(|e| format!("Invalid JSON: {e}"))?; + let mut new_doc: Document = serde_json::from_str(doc_json).map_err(|e| format!("Invalid JSON: {e}"))?; + new_doc.remove("_id"); let col = client.database(database).collection::(collection); let result = col.replace_one(doc! { "_id": oid }, new_doc).await.map_err(|e| e.to_string())?; Ok(result.modified_count) diff --git a/src/components/grid/DataGrid.vue b/src/components/grid/DataGrid.vue index 35f1472b7..949397636 100644 --- a/src/components/grid/DataGrid.vue +++ b/src/components/grid/DataGrid.vue @@ -1984,7 +1984,7 @@ defineExpose({ autocorrect="off" spellcheck="false" class="flex-1 h-5 min-w-0 text-xs bg-transparent outline-none placeholder:text-muted-foreground/60" - placeholder="condition..." + placeholder="" @keydown="onWhereFilterKeydown" @click="updateWhereSuggestionPosition" @blur="dismissWhereSuggestions" @@ -2037,7 +2037,7 @@ defineExpose({ autocorrect="off" spellcheck="false" class="flex-1 h-5 min-w-0 text-xs bg-transparent outline-none placeholder:text-muted-foreground/60" - placeholder="columns..." + placeholder="" @keydown="onOrderByKeydown" @click="updateOrderBySuggestionPosition" @blur="dismissOrderBySuggestions"