add access token in parser method

This commit is contained in:
argirok 2022-11-11 12:28:07 +02:00
parent 8e22fe60b0
commit ce4b358ce9
1 changed files with 5 additions and 4 deletions

View File

@ -138,19 +138,20 @@ export class EGIDataTransferComponent {
this.status = "loading"; this.status = "loading";
this.message = null; this.message = null;
this.downloadElements = []; this.downloadElements = [];
this.subscriptions.push(this.http.get(this.APIURL + "/parser?doi=" + encodeURIComponent(this.selectedSourceUrl)).subscribe( let headers = new HttpHeaders({'Authorization': 'Bearer '+this.accessToken});
this.subscriptions.push(this.http.get(this.APIURL + "/parser?doi=" + encodeURIComponent(this.selectedSourceUrl), {headers: headers}).subscribe(
res => { res => {
this.downloadElements= res['elements'] this.downloadElements= res['elements']
// console.log(this.downloadElements) // console.log(this.downloadElements)
this.status = "init"; this.status = "init";
}, error => { }, error => {
this.status = "errorParser"; this.status = "errorParser";
this.message = error.error && error.error.id && error.error.id == 'doiNotSupported'?'DOI not supported':( error.error && error.error.id && error.error.id? error.error.id:'Error parsing information') ; this.message = error.error && error.error.id && error.error.id == 'doiNotSupported'?'DOI not supported':( error.error && error.error.description && error.error.description? error.error.description:'Error parsing information') ;
UIkit.notification(this.message, { /* UIkit.notification(this.message, {
status: 'error', status: 'error',
timeout: 3000, timeout: 3000,
pos: 'bottom-right' pos: 'bottom-right'
}); });*/
} }
)); ));