File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -671,8 +671,8 @@ export class JSORMBase {
671
671
static fetchOptions ( ) : RequestInit {
672
672
const options = {
673
673
headers : {
674
- Accept : "application/json" ,
675
- [ "Content-Type" ] : "application/json"
674
+ Accept : "application/vnd.api+ json" ,
675
+ [ "Content-Type" ] : "application/vnd.api+ json"
676
676
} as any
677
677
}
678
678
@@ -941,4 +941,4 @@ export const isModelInstance = (arg: any): arg is JSORMBase => {
941
941
return false
942
942
}
943
943
return isModelClass ( arg . constructor . currentClass )
944
- }
944
+ }
Original file line number Diff line number Diff line change @@ -152,8 +152,8 @@ describe("fetch middleware", () => {
152
152
expect ( before . url ) . to . eq ( "http://example.com/api/v1/authors" )
153
153
expect ( before . options ) . to . deep . eq ( {
154
154
headers : {
155
- Accept : "application/json" ,
156
- "Content-Type" : "application/json" ,
155
+ Accept : "application/vnd.api+ json" ,
156
+ "Content-Type" : "application/vnd.api+ json" ,
157
157
"CUSTOM-HEADER" : "whatever"
158
158
} ,
159
159
method : "GET"
@@ -309,9 +309,9 @@ describe("fetch middleware", () => {
309
309
expect ( before . url ) . to . eq ( "http://example.com/api/v1/authors" )
310
310
expect ( before . options ) . to . deep . eq ( {
311
311
headers : {
312
- Accept : "application/json" ,
312
+ Accept : "application/vnd.api+ json" ,
313
313
"CUSTOM-HEADER" : "whatever" ,
314
- "Content-Type" : "application/json"
314
+ "Content-Type" : "application/vnd.api+ json"
315
315
} ,
316
316
body : JSON . stringify ( { data : { type : "authors" } } ) ,
317
317
method : "POST"
Original file line number Diff line number Diff line change @@ -1485,8 +1485,8 @@ describe("Model", () => {
1485
1485
1486
1486
it ( "includes the content headers" , ( ) => {
1487
1487
const headers : any = Author . fetchOptions ( ) . headers
1488
- expect ( headers . Accept ) . to . eq ( "application/json" )
1489
- expect ( headers [ "Content-Type" ] ) . to . eq ( "application/json" )
1488
+ expect ( headers . Accept ) . to . eq ( "application/vnd.api+ json" )
1489
+ expect ( headers [ "Content-Type" ] ) . to . eq ( "application/vnd.api+ json" )
1490
1490
} )
1491
1491
} )
1492
1492
} )
You can’t perform that action at this time.
0 commit comments