1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-11 01:14:36 +00:00

fix: update fileUpload method to override existing config

This commit is contained in:
2021-07-18 21:34:16 +05:00
parent 7cb2a43f95
commit 69999d8e8b

View File

@@ -540,11 +540,22 @@ export default class SASjs {
* Process). Is prepended at runtime with the value of `appLoc`.
* @param files - array of files to be uploaded, including File object and file name.
* @param params - request URL parameters.
* @param config - object to override existing config (optional)
*/
public uploadFile(sasJob: string, files: UploadFile[], params: any) {
const fileUploader =
this.fileUploader ||
new FileUploader(this.sasjsConfig, this.jobsPath, this.requestClient!)
public uploadFile(
sasJob: string,
files: UploadFile[],
params: any,
config?: any
) {
const fileUploader = config
? new FileUploader(
{ ...this.sasjsConfig, ...config },
this.jobsPath,
this.requestClient!
)
: this.fileUploader ||
new FileUploader(this.sasjsConfig, this.jobsPath, this.requestClient!)
return fileUploader.uploadFile(sasJob, files, params)
}