This repository was archived by the owner on Nov 19, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 21
21
*/
22
22
23
23
import { Injectable } from '@angular/core' ;
24
- import { Http } from '@angular/http' ;
24
+ import { Http , Headers } from '@angular/http' ;
25
25
26
26
import { Observable } from 'rxjs/Observable' ;
27
27
@@ -35,8 +35,8 @@ export class CommonApiService {
35
35
36
36
constructor ( protected http : Http ) { }
37
37
38
- fetchUrl ( url : string ) : Promise < Object > {
39
- return this . http . get ( url )
38
+ fetchUrl ( url : string , options ?: Object ) : Promise < Object > {
39
+ return this . http . get ( url , options )
40
40
. map ( res => res . json ( ) )
41
41
. toPromise ( ) ;
42
42
}
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ export class RecordApiService extends CommonApiService {
39
39
private currentRecordId : string ;
40
40
41
41
private readonly returnOnlyIdsHeaders = new Headers ( { Accept : 'application/vnd+inspire.ids+json' } ) ;
42
+ private readonly rawJsonDataHeaders = new Headers ( { Accept : 'application/vnd+inspire.record.raw+json' } ) ;
42
43
43
44
readonly newRecordFetched$ = new ReplaySubject < void > ( 1 ) ;
44
45
@@ -58,7 +59,7 @@ export class RecordApiService extends CommonApiService {
58
59
this . currentRecordApiUrl = `${ apiUrl } /${ pidType } /${ pidValue } ` ;
59
60
this . currentRecordEditorApiUrl = `${ editorApiUrl } /${ pidType } /${ pidValue } ` ;
60
61
this . newRecordFetched$ . next ( null ) ;
61
- return this . fetchUrl ( this . currentRecordApiUrl ) ;
62
+ return this . fetchUrl ( this . currentRecordApiUrl , { headers : this . rawJsonDataHeaders } ) ;
62
63
}
63
64
64
65
saveRecord ( record : object ) : Observable < void > {
You can’t perform that action at this time.
0 commit comments