fix: allow deleting desktop providers

This commit is contained in:
boos
2026-06-29 15:22:40 +08:00
parent 7dd099b2e9
commit 0515b90b6c
4 changed files with 122 additions and 17 deletions
+7 -3
View File
@@ -77,9 +77,13 @@ pub async fn update_provider(
#[tauri::command]
pub async fn delete_provider(state: State<'_, AppState>, id: String) -> Result<(), String> {
// Virtual built-in providers have no DB row — deletion is a no-op (they'll reappear)
if id.starts_with("builtin_") {
return Ok(());
if let Some(builtin_id) = id.strip_prefix("builtin_") {
return boosapi_core::repo::provider::mark_builtin_provider_deleted(
&state.sea_db,
builtin_id,
)
.await
.map_err(|e| e.to_string());
}
boosapi_core::repo::provider::delete_provider(&state.sea_db, &id)
.await