Skip to content

Commit 3ac9e62

Browse files
undo destructuring of response and fix respective TS type
1 parent 0957b94 commit 3ac9e62

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1467,7 +1467,7 @@ export default class Client {
14671467
* @return Promise<Comment[]>
14681468
*/
14691469
async loadComments(ticketId: string, params: Record<string, any>) {
1470-
const { data } = await entities.Comment.query(ticketId, params);
1470+
const data = await entities.Comment.query(ticketId, params);
14711471
const page = params.page || 1;
14721472
const PAGE_SIZE = 50;
14731473
const pages = Math.ceil(data.count / PAGE_SIZE);

src/model/Comment.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ const paramDefaults = {};
1010
const createableField = ["body", "ticket_id", "attachments", "author_id"];
1111

1212
export type CommentsResponse = {
13-
data: {
14-
comments: Comment[];
15-
count: number;
16-
} & APIObject;
17-
};
13+
comments: Comment[];
14+
count: number;
15+
} & APIObject;
1816

1917
export class Comment extends Ressource {
2018
id: string;

0 commit comments

Comments
 (0)