Skip to content

Commit 3dd1ca9

Browse files
committed
Use fileUploads object to create FileUpload
1 parent 0ff67ee commit 3dd1ca9

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

examples/shared/files.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,7 @@ const JSON_HEADERS = {
2525

2626
async function createFileUpload(options = { mode: 'single_part' }) {
2727
try {
28-
const response = await axios({
29-
method: 'POST',
30-
url: NOTION_FILE_UPLOAD_URL,
31-
headers: JSON_HEADERS,
32-
data: options,
33-
});
34-
35-
return response.data;
28+
return await notion.fileUploads.create(options);
3629
} catch (error) {
3730
console.error('Error creating file upload:', error);
3831
throw error;

0 commit comments

Comments
 (0)