fix: allow deleting desktop providers
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user