X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/172ba18e43743d90b8a1110d62209be2ab7627d1..21d7f6cb32902073193db810b4dfad85d9cdff7e:/src/common/webdav.ts diff --git a/src/common/webdav.ts b/src/common/webdav.ts index 93ec21cb72..d4f904ae98 100644 --- a/src/common/webdav.ts +++ b/src/common/webdav.ts @@ -30,6 +30,12 @@ export class WebDAV { data }) + get = (url: string, config: WebDAVRequestConfig = {}) => + this.request({ + ...config, url, + method: 'GET' + }) + upload = (url: string, files: File[], config: WebDAVRequestConfig = {}) => { return Promise.all( files.map(file => this.request({ @@ -88,7 +94,7 @@ export class WebDAV { Object.assign(window, { cancelTokens: {} }); } - (window as any).cancelTokens[config.url] = () => { + (window as any).cancelTokens[config.url] = () => { resolve(r); r.abort(); } @@ -138,4 +144,4 @@ interface RequestConfig { headers?: { [key: string]: string }; data?: any; onUploadProgress?: (event: ProgressEvent) => void; -} \ No newline at end of file +}