Adding post id support

This commit is contained in:
Fabian Stamm 2019-01-18 19:11:34 +01:00
parent 9b57728892
commit 500bb33689
1 changed files with 4 additions and 1 deletions

View File

@ -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<IFile> {
async create(name: string, data: ArrayBuffer | ArrayBufferView, type: "text" | "binary", folder?: string, preview?: string, id?: string): Promise<IFile> {
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;