Skip to content

Commit

Permalink
Merge pull request #703 from zapier/jasonkotenko-patch-1
Browse files Browse the repository at this point in the history
docs(cli): update z.cursor docs for how to handle reaching the end of the result set
  • Loading branch information
eliangcs authored Oct 16, 2023
2 parents 6279451 + 2f1bbb2 commit 1ac0462
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5576,8 +5576,8 @@ <h3 id="whats-the-deal-with-pagination-when-is-it-used-and-how-does-it-work">Wha
);

<span class="hljs-comment">// after fetching a page, set the returned cursor for the next page,</span>
<span class="hljs-comment">// or empty/null if this was the last one.</span>
<span class="hljs-keyword">await</span> z.cursor.set(response.nextPage);
<span class="hljs-comment">// or an empty string if the cursor is null</span>
<span class="hljs-keyword">await</span> z.cursor.set(response.nextPage ?? <span class="hljs-string">&apos;&apos;</span>);

<span class="hljs-keyword">return</span> response.items;
};
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3524,8 +3524,8 @@ const perform = async (z, bundle) => {
);
// after fetching a page, set the returned cursor for the next page,
// or empty/null if this was the last one.
await z.cursor.set(response.nextPage);
// or an empty string if the cursor is null
await z.cursor.set(response.nextPage ?? '');
return response.items;
};
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5576,8 +5576,8 @@ <h3 id="whats-the-deal-with-pagination-when-is-it-used-and-how-does-it-work">Wha
);

<span class="hljs-comment">// after fetching a page, set the returned cursor for the next page,</span>
<span class="hljs-comment">// or empty/null if this was the last one.</span>
<span class="hljs-keyword">await</span> z.cursor.set(response.nextPage);
<span class="hljs-comment">// or an empty string if the cursor is null</span>
<span class="hljs-keyword">await</span> z.cursor.set(response.nextPage ?? <span class="hljs-string">&apos;&apos;</span>);

<span class="hljs-keyword">return</span> response.items;
};
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/snippets/paging-cursor.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ const perform = async (z, bundle) => {
);

// after fetching a page, set the returned cursor for the next page,
// or empty/null if this was the last one.
await z.cursor.set(response.nextPage);
// or an empty string if the cursor is null
await z.cursor.set(response.nextPage ?? '');

return response.items;
};

0 comments on commit 1ac0462

Please sign in to comment.