Skip to content

Commit d40af11

Browse files
authored
Merge pull request #7 from zweckj/fix/update-204
fix: handle 204 on item update
2 parents 5e03680 + f97c067 commit d40af11

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

onedrive_personal_sdk/clients/client.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,17 @@ async def download_drive_item(
8585

8686
async def update_drive_item(
8787
self, path_or_id: str, data: ItemUpdate
88-
) -> File | Folder:
88+
) -> File | Folder | None:
8989
"""Update items in a drive."""
90-
response = await self._request_json(
90+
response = await self._request(
9191
HttpMethod.PATCH,
9292
f"{GRAPH_BASE_URL}/me/drive/items/{path_or_id}",
9393
json=data.to_dict(),
9494
)
95-
return self._dict_to_item(response)
95+
if response.status == 204:
96+
return None
97+
json = await response.json()
98+
return self._dict_to_item(json)
9699

97100
async def create_folder(
98101
self,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "onedrive-personal-sdk"
3-
version = "0.0.14"
3+
version = "0.0.15"
44
license = {text = "MIT"}
55
description = "A package to interact with the Microsoft Graph API for personal OneDrives."
66
readme = "README.md"

0 commit comments

Comments
 (0)