fix: delete empty git connection (#6318)

This commit is contained in:
Alexander Petric
2025-08-01 12:35:40 -04:00
committed by GitHub
parent 523bc2023b
commit 8d05696809
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -1154,8 +1154,10 @@ async fn delete_git_sync_repository(
) -> Result<String> {
require_admin(is_admin, &username)?;
// Validate the resource path format
validate_git_repo_resource_path(&request.git_repo_resource_path)?;
// For deletion, only validate that path is not empty to allow cleanup of malformed entries
if request.git_repo_resource_path.is_empty() {
return Err(Error::BadRequest("Resource path cannot be empty".to_string()));
}
let mut tx = db.begin().await?;
@@ -192,7 +192,7 @@ export function createGitSyncContext(workspace: string) {
)
// Only call backend API if repository exists in the saved state
if (existsInInitialState && repo.git_repo_resource_path) {
if (existsInInitialState) {
await WorkspaceService.deleteGitSyncRepository({
workspace,
requestBody: {