add access token in parser method
This commit is contained in:
parent
8e22fe60b0
commit
ce4b358ce9
|
@ -138,19 +138,20 @@ export class EGIDataTransferComponent {
|
|||
this.status = "loading";
|
||||
this.message = null;
|
||||
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 => {
|
||||
this.downloadElements= res['elements']
|
||||
// console.log(this.downloadElements)
|
||||
this.status = "init";
|
||||
}, error => {
|
||||
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') ;
|
||||
UIkit.notification(this.message, {
|
||||
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, {
|
||||
status: 'error',
|
||||
timeout: 3000,
|
||||
pos: 'bottom-right'
|
||||
});
|
||||
});*/
|
||||
|
||||
}
|
||||
));
|
||||
|
|
Loading…
Reference in New Issue