fix: show error for duplicate folder name + add client-side validation
CreateDirectory now returns an error when the folder already exists instead of silently succeeding. JS validates folder name format (alphanumeric + underscore, max 32 chars) before sending the request. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -148,7 +148,7 @@ func CreateDirectory(basePath, name string) (string, error) {
|
||||
// Check if already exists
|
||||
if fi, err := os.Stat(targetPath); err == nil {
|
||||
if fi.IsDir() {
|
||||
return targetPath, nil // already exists, idempotent
|
||||
return "", fmt.Errorf("a mappa már létezik: %s", name)
|
||||
}
|
||||
return "", fmt.Errorf("a cél már létezik és nem mappa")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user