Skip to content

Commit 76ed734

Browse files
committed
Pagination
1 parent 34b212f commit 76ed734

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

components/trustpilot/sources/new-service-reviews/new-service-reviews.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ export default {
5656
}
5757

5858
// Use the shared method from the app directly
59-
const result = await this.trustpilot.fetchServiceReviews(fetchParams);
59+
let result = await this.trustpilot.fetchServiceReviews(fetchParams);
60+
61+
while (result.length === 100) {
62+
fetchParams.page += 1;
63+
result = result.concat(await this.trustpilot.fetchServiceReviews(fetchParams));
64+
}
6065

6166
const reviews = result.reviews || [];
6267

0 commit comments

Comments
 (0)