mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-08 23:32:40 +02:00
feat: enhance OneDrive file creation by converting markdown to DOCX format and updating client to handle byte content
This commit is contained in:
parent
dc034a98eb
commit
8035eb9749
3 changed files with 50 additions and 6 deletions
|
|
@ -224,12 +224,15 @@ class OneDriveClient:
|
|||
self,
|
||||
name: str,
|
||||
parent_id: str | None = None,
|
||||
content: str | None = None,
|
||||
content: str | bytes | None = None,
|
||||
mime_type: str | None = None,
|
||||
) -> dict[str, Any]:
|
||||
"""Create (upload) a file in OneDrive."""
|
||||
folder_path = f"/me/drive/items/{parent_id or 'root'}"
|
||||
body = (content or "").encode("utf-8")
|
||||
if isinstance(content, bytes):
|
||||
body = content
|
||||
else:
|
||||
body = (content or "").encode("utf-8")
|
||||
resp = await self._request(
|
||||
"PUT",
|
||||
f"{folder_path}:/{name}:/content",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue