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:
2026-02-18 21:37:54 +01:00
parent 6b7ca566df
commit 30110d3fca
2 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -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")
}