We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ff67ee commit 3dd1ca9Copy full SHA for 3dd1ca9
examples/shared/files.js
@@ -25,14 +25,7 @@ const JSON_HEADERS = {
25
26
async function createFileUpload(options = { mode: 'single_part' }) {
27
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;
+ return await notion.fileUploads.create(options);
36
} catch (error) {
37
console.error('Error creating file upload:', error);
38
throw error;
0 commit comments