Skip to content

Commit

Permalink
[Notion] config - ignore new pages but not updates (#14144)
Browse files Browse the repository at this point in the history
* ignore new pages but not updates

* bump versions
  • Loading branch information
andrewjschuang authored Sep 30, 2024
1 parent a3c822c commit afa8fb1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/notion/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/notion",
"version": "0.2.0",
"version": "0.2.1",
"description": "Pipedream Notion Components",
"main": "notion.app.mjs",
"keywords": [
Expand Down
9 changes: 7 additions & 2 deletions components/notion/sources/updated-page/updated-page.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
key: "notion-updated-page",
name: "Updated Page in Database", /* eslint-disable-line pipedream/source-name */
description: "Emit new event when a page in a database is updated. To select a specific page, use `Updated Page ID` instead",
version: "0.1.0",
version: "0.1.1",
type: "source",
dedupe: "unique",
props: {
Expand Down Expand Up @@ -171,7 +171,7 @@ export default {
});
}

if (!pageExistsInDB && this.includeNewPages) {
if (!pageExistsInDB) {
isNewPage = true;
propertyHasChanged = true;
propertyValues[page.id] = {
Expand All @@ -185,6 +185,11 @@ export default {
}
}

if (isNewPage && !this.includeNewPages) {
console.log(`Ignoring new page: ${page.id}`);
continue;
}

if (propertyHasChanged) {
this.emitEvent(page, changes, isNewPage);
}
Expand Down

0 comments on commit afa8fb1

Please sign in to comment.