From 847a8de41483854f0c58be4f9f334ca856a588b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6sche?= Date: Tue, 13 Jan 2026 22:31:58 +0100 Subject: [PATCH] Refactor moveUserFileHandler to store user files directly in WebDAV root, removing unnecessary path prefix --- go_cloud/internal/http/routes.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/go_cloud/internal/http/routes.go b/go_cloud/internal/http/routes.go index 99dbe07..a84d320 100644 --- a/go_cloud/internal/http/routes.go +++ b/go_cloud/internal/http/routes.go @@ -1640,10 +1640,9 @@ func moveUserFileHandler(w http.ResponseWriter, r *http.Request, db *database.DB if err != nil { errors.LogError(r, err, "Failed to get user WebDAV client (continuing with database operation)") } else { - sourceRel := strings.TrimPrefix(req.SourcePath, "/") - sourcePath := path.Join("/users", userID.String(), sourceRel) - targetRel := strings.TrimPrefix(newPath, "/") - targetPath := path.Join("/users", userID.String(), targetRel) + // User files are stored directly in the user's WebDAV root (no /users/{id} prefix) + sourcePath := "/" + strings.TrimPrefix(req.SourcePath, "/") + targetPath := "/" + strings.TrimPrefix(newPath, "/") if err := storageClient.Move(r.Context(), sourcePath, targetPath); err != nil { errors.LogError(r, err, "Failed to move in Nextcloud (continuing with database operation)") }