STYLE: Refactor code for improved readability and consistency
This commit is contained in:
@@ -1587,7 +1587,6 @@ func moveUserFileHandler(w http.ResponseWriter, r *http.Request, db *database.DB
|
||||
w.Write([]byte(`{"status":"ok"}`))
|
||||
}
|
||||
|
||||
|
||||
// deleteUserFileHandler deletes a file/folder in user's personal workspace by path
|
||||
func deleteUserFileHandler(w http.ResponseWriter, r *http.Request, db *database.DB, auditLogger *audit.Logger, cfg *config.Config) {
|
||||
userIDStr, ok := middleware.GetUserID(r.Context())
|
||||
|
||||
@@ -225,7 +225,7 @@ func (c *WebDAVClient) Move(ctx context.Context, sourcePath, targetPath string)
|
||||
|
||||
sourceRel := strings.TrimLeft(sourcePath, "/")
|
||||
targetRel := strings.TrimLeft(targetPath, "/")
|
||||
|
||||
|
||||
u := c.basePrefix
|
||||
if u == "/" || u == "" {
|
||||
u = ""
|
||||
@@ -272,4 +272,3 @@ func (c *WebDAVClient) Move(ctx context.Context, sourcePath, targetPath string)
|
||||
body, _ := io.ReadAll(resp.Body)
|
||||
return fmt.Errorf("webdav move failed: %d %s", resp.StatusCode, string(body))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user