import { ModelClient } from '../client/model-client'; import { Comment, PatchedComment } from './comment'; export class CommentClient extends ModelClient { pluralName = 'comments'; async list(id: string, queryParams?: any): Promise { const options = queryParams ? { object: id } : { object: id, ...queryParams }; const response = await this.listPage( `/${this.version}/${this.pluralName}`, options ); const results = response.results; if (response.next) { const nextPage = await this.listPage(response.next, queryParams); return [...results, ...nextPage.results]; } return results; } }