UNPKG

@udus/notion-renderer

Version:
16 lines (15 loc) 481 B
import { callAPIWithBackOff } from "../utils/api.js"; export const listComments = async (client, args) => { const { ok, data } = await callAPIWithBackOff(client.comments.list, args); if (!ok) { return []; } if (data.next_cursor) { const nextResults = await listComments(client, { ...args, start_cursor: data.next_cursor, }); data.results = [...data.results, ...nextResults]; } return data.results; };