Skip to content

Commit

Permalink
fix: add attachment file name
Browse files Browse the repository at this point in the history
  • Loading branch information
UnderKoen committed Oct 24, 2023
1 parent a703512 commit 87e8a33
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/salesInvoice.ts
Expand Up @@ -2,7 +2,8 @@ import { HttpHandler } from "./httpHandler";
import { Moneybird } from "./moneybird";
import { Administration } from "./administration";
import {
IAttachment, IPayment,
IAttachment,
IPayment,
IPaymentCreate,
ISalesInvoice,
ISalesInvoiceSending,
Expand Down Expand Up @@ -98,9 +99,12 @@ export class SalesInvoice {
/**
* Add attachment to the sales invoice
*/
public async addAttachment(content: ArrayBuffer): Promise<void> {
public async addAttachment(
content: ArrayBuffer,
file_name?: string
): Promise<void> {
const formData = new FormData();
formData.append("file", new Blob([content]));
formData.append("file", new Blob([content]), file_name);

return this.HTTP.POST("attachments", formData, {
headers: {
Expand Down

0 comments on commit 87e8a33

Please sign in to comment.