File tree 1 file changed +4
-2
lines changed
packages/json-api/src/-private/builders
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ export interface JSONAPIConfig extends BuildURLConfig {
17
17
}
18
18
19
19
const JsonApiAccept = 'application/vnd.api+json' ;
20
- export let CONFIG : JSONAPIConfig = { host : '' , namespace : '' } ;
20
+ const DEFAULT_CONFIG : JSONAPIConfig = { host : '' , namespace : '' } ;
21
+ export let CONFIG : JSONAPIConfig = DEFAULT_CONFIG ;
21
22
export let ACCEPT_HEADER_VALUE = 'application/vnd.api+json' ;
22
23
23
24
/**
@@ -62,7 +63,7 @@ export let ACCEPT_HEADER_VALUE = 'application/vnd.api+json';
62
63
* @returns void
63
64
*/
64
65
export function setBuildURLConfig ( config : JSONAPIConfig ) : void {
65
- Object . assign ( CONFIG , config ) ;
66
+ CONFIG = Object . assign ( { } , DEFAULT_CONFIG , config ) ;
66
67
67
68
if ( config . profiles || config . extensions ) {
68
69
let accept = JsonApiAccept ;
@@ -78,6 +79,7 @@ export function setBuildURLConfig(config: JSONAPIConfig): void {
78
79
accept += ';ext=' + extensions . join ( ' ' ) ;
79
80
}
80
81
}
82
+ ACCEPT_HEADER_VALUE = accept ;
81
83
}
82
84
83
85
setConfig ( config ) ;
You can’t perform that action at this time.
0 commit comments