Skip to content

Commit 3ab227f

Browse files
fix - run only on page on first run
1 parent ea4b419 commit 3ab227f

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

components/hubspot/sources/common/common.mjs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default {
1414
},
1515
methods: {
1616
_getAfter() {
17-
return this.db.get("after") || new Date().setDate(new Date().getDate() - 1); // 1 day ago
17+
return this.db.get("after");
1818
},
1919
_setAfter(after) {
2020
this.db.set("after", after);
@@ -92,6 +92,11 @@ export default {
9292
return;
9393
}
9494
}
95+
96+
// first run, get only first page
97+
if (!after) {
98+
return;
99+
}
95100
}
96101
},
97102
// pagination for endpoints that return hasMore property of true/false
@@ -128,6 +133,11 @@ export default {
128133
}
129134
}
130135
}
136+
137+
// first run, get only first page
138+
if (!after) {
139+
return;
140+
}
131141
}
132142
},
133143
async getPaginatedItems(resourceFn, params) {

components/hubspot/sources/new-or-updated-contact/new-or-updated-contact.mjs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,10 @@ export default {
101101
const dateProperty = this.newOnly
102102
? "createdate"
103103
: "lastmodifieddate";
104-
const isFirstRun = !this.db.get("after");
105104

106105
const params = {
107106
data: {
108-
limit: isFirstRun
109-
? 100
110-
: DEFAULT_LIMIT,
107+
limit: DEFAULT_LIMIT,
111108
sorts: [
112109
{
113110
propertyName: dateProperty,

0 commit comments

Comments
 (0)