From 500bb3368969245fc6dc44a96f9bbfdf02748ddc Mon Sep 17 00:00:00 2001 From: Fabian Stamm Date: Fri, 18 Jan 2019 19:11:34 +0100 Subject: [PATCH] Adding post id support --- src/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 37cf56a..57c8b4f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -166,7 +166,7 @@ export default class SecureFileWrapper { return d.files; } - async create(name: string, data: ArrayBuffer | ArrayBufferView, type: "text" | "binary", folder?: string, preview?: string): Promise { + async create(name: string, data: ArrayBuffer | ArrayBufferView, type: "text" | "binary", folder?: string, preview?: string, id?: string): Promise { let params: any = { type: type, name: name }; if (preview) { params.preview = preview; @@ -174,6 +174,9 @@ export default class SecureFileWrapper { if (folder) { params.folder = folder; } + if (id) { + params.id = id + } let res = await this.makeRequest("/files", "POST", params, data); return (await res.json()).file;