Skip to content

Commit 2043cd7

Browse files
feat: allow pdf statements (#100)
* feat: allow pdf statements * Update statements.ts Co-authored-by: Ilya Merman <[email protected]>
1 parent 8030e31 commit 2043cd7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

resources/statements.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ export class Statments extends BaseResource {
1818
return this.httpGet<UnitResponse<Statement[]>>("", { params: parameters })
1919
}
2020

21-
public get(statementId: string, customerId?: string): Promise<string> {
21+
public get(statementId: string, customerId?: string, isPDF = false): Promise<string> {
2222
const parameters = {
2323
...(customerId && { "filter[customerId]": customerId })
2424
}
2525

26-
return this.httpGet<string>(`/${statementId}/html`, {params: parameters})
26+
const url = isPDF ? `/${statementId}/pdf` : `/${statementId}/html`
27+
return this.httpGet<string>(url, {params: parameters})
2728
}
2829
}
2930

0 commit comments

Comments
 (0)