Skip to content

Commit

Permalink
core: do not error when deleting a folder that does not exist (#9377)
Browse files Browse the repository at this point in the history
  • Loading branch information
spolu authored Dec 13, 2024
1 parent cd0ec49 commit 0da6883
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions core/bin/core_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2374,11 +2374,14 @@ async fn tables_delete(
"Failed to load table",
Some(e),
),
Ok(None) => error_response(
StatusCode::NOT_FOUND,
"table_not_found",
&format!("No table found for id `{}`", table_id),
None,
Ok(None) => (
StatusCode::OK,
Json(APIResponse {
error: None,
response: Some(json!({
"success": true,
})),
}),
),
Ok(Some(table)) => {
match table
Expand Down Expand Up @@ -3029,11 +3032,14 @@ async fn folders_delete(
"Failed to load folder",
Some(e),
),
Ok(None) => error_response(
StatusCode::NOT_FOUND,
"folder_not_found",
&format!("No folder found for id `{}`", folder_id),
None,
Ok(None) => (
StatusCode::OK,
Json(APIResponse {
error: None,
response: Some(json!({
"success": true,
})),
}),
),
Ok(Some(_)) => {
match state
Expand Down

0 comments on commit 0da6883

Please sign in to comment.