Skip to content

Instantly share code, notes, and snippets.

@typeoneerror
Created January 18, 2023 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save typeoneerror/17ea2056983e2b1d2eb42e0ebd75b262 to your computer and use it in GitHub Desktop.
Save typeoneerror/17ea2056983e2b1d2eb42e0ebd75b262 to your computer and use it in GitHub Desktop.
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