mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Fixed unit test
This commit is contained in:
@@ -33,7 +33,6 @@ declare let AlfrescoApi: any;
|
||||
*/
|
||||
@Injectable()
|
||||
export class UploadService {
|
||||
private _baseUrlPath: string = '/alfresco/api/-default-/public/alfresco/versions/1';
|
||||
private _url: string = '/alfresco/service/api/upload';
|
||||
|
||||
private _method: string = 'POST';
|
||||
@@ -66,7 +65,6 @@ export class UploadService {
|
||||
*/
|
||||
public setOptions(options: any): void {
|
||||
this._url = options.url || this._url;
|
||||
this._baseUrlPath = options.baseUrlPath || this._baseUrlPath;
|
||||
this._formFields = options.formFields != null ? options.formFields : this._formFields;
|
||||
}
|
||||
|
||||
@@ -86,14 +84,6 @@ export class UploadService {
|
||||
return this._url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the base url
|
||||
* @returns {string}
|
||||
*/
|
||||
public getBaseUrl(): string {
|
||||
return this._baseUrlPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the form fields
|
||||
* @returns {Object}
|
||||
@@ -224,7 +214,7 @@ export class UploadService {
|
||||
let xmlHttpRequest = this.createXMLHttpRequestInstance(uploadingFileModel, elementEmit);
|
||||
uploadingFileModel._xmlHttpRequest = xmlHttpRequest;
|
||||
|
||||
xmlHttpRequest.open(this._method, this.getHost() + this._url, true);
|
||||
xmlHttpRequest.open(this._method, this.getHost() + this.getUrl(), true);
|
||||
let authToken = btoa(basicAuth.username + ':' + basicAuth.password);
|
||||
if (authToken) {
|
||||
xmlHttpRequest.setRequestHeader('Authorization', `${basicAuth.type} ${authToken}`);
|
||||
|
Reference in New Issue
Block a user