mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-22 16:02:24 +00:00
fix: delete empty git connection (#6318)
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user