Skip to content

Commit

Permalink
fix: return types on list tags + webhooks (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
kvithana authored Oct 18, 2020
1 parent 0f25871 commit 23f112a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/tags/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@ export class TagsApi {
* Retrieve a list of all tags currently in use. The returned list is not
* paginated.
*/
public async list(
params: ListTagsRequest = {}
): Promise<{ data: ListTagsResponse[] }> {
public async list(params: ListTagsRequest = {}): Promise<ListTagsResponse> {
const urlParams = [];
if (params.pageSize) {
urlParams.push(`page[size]=${params.pageSize}`);
}

return this.api.get<{ data: ListTagsResponse[] }>(
return this.api.get<ListTagsResponse>(
`${ENDPOINTS.TAGS}?${urlParams.join('&')}`
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/webhooks/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ export class WebhookApi {
*/
public async list(
params: ListWebhooksRequest = {}
): Promise<{ data: ListWebhooksResponse[] }> {
): Promise<ListWebhooksResponse> {
const urlParams = [];
if (params.pageSize) {
urlParams.push(`page[size]=${params.pageSize}`);
}

return this.api.get<{ data: ListWebhooksResponse[] }>(
return this.api.get<ListWebhooksResponse>(
`${ENDPOINTS.WEBHOOKS}?${urlParams.join('&')}`
);
}
Expand Down

0 comments on commit 23f112a

Please sign in to comment.