fix: Bugs created after the overhaul, performance and layout fixes
This commit is contained in:
@@ -312,3 +312,18 @@ async def delete_file(relative_path: str) -> None:
|
||||
resp = await client.request("DELETE", url, auth=_auth())
|
||||
if resp.status_code not in (200, 204, 404):
|
||||
raise HTTPException(status_code=502, detail=f"Nextcloud delete failed: {resp.status_code}")
|
||||
|
||||
|
||||
async def rename_folder(old_relative_path: str, new_relative_path: str) -> None:
|
||||
"""Rename/move a folder in Nextcloud using WebDAV MOVE."""
|
||||
url = _full_url(old_relative_path)
|
||||
destination = _full_url(new_relative_path)
|
||||
client = _get_client()
|
||||
resp = await client.request(
|
||||
"MOVE",
|
||||
url,
|
||||
auth=_auth(),
|
||||
headers={"Destination": destination, "Overwrite": "F"},
|
||||
)
|
||||
if resp.status_code not in (201, 204):
|
||||
raise HTTPException(status_code=502, detail=f"Nextcloud rename failed: {resp.status_code}")
|
||||
|
||||
Reference in New Issue
Block a user