Created
January 18, 2023 20:14
-
-
Save typeoneerror/17ea2056983e2b1d2eb42e0ebd75b262 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { notion, yargs } = require('../../shared'); | |
const { fetchAllPages, performWithAll } = require('../../shared/fetch-pages'); | |
const databaseId = 'e6a07b67d28a432fbd9029f18f3a27b8'; | |
async function editPage(page) { | |
const params = { | |
page_id: page.id, | |
icon: { | |
type: 'emoji', | |
emoji: '😁', | |
}, | |
}; | |
return await notion.pages.update(params); | |
} | |
(async () => { | |
// Fetches all pages in batches until they are all fetched | |
const pages = await fetchAllPages(databaseId); | |
// Run the "editPage" routine on each page | |
performWithAll(pages, editPage); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment