forked from hibas123/SecureFileWrapper
Adding post id support
This commit is contained in:
parent
9b57728892
commit
500bb33689
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user