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 {
671671 static fetchOptions ( ) : RequestInit {
672672 const options = {
673673 headers : {
674- Accept : "application/json" ,
675- [ "Content-Type" ] : "application/json"
674+ Accept : "application/vnd.api+ json" ,
675+ [ "Content-Type" ] : "application/vnd.api+ json"
676676 } as any
677677 }
678678
@@ -941,4 +941,4 @@ export const isModelInstance = (arg: any): arg is JSORMBase => {
941941 return false
942942 }
943943 return isModelClass ( arg . constructor . currentClass )
944- }
944+ }
Original file line number Diff line number Diff line change @@ -152,8 +152,8 @@ describe("fetch middleware", () => {
152152 expect ( before . url ) . to . eq ( "http://example.com/api/v1/authors" )
153153 expect ( before . options ) . to . deep . eq ( {
154154 headers : {
155- Accept : "application/json" ,
156- "Content-Type" : "application/json" ,
155+ Accept : "application/vnd.api+ json" ,
156+ "Content-Type" : "application/vnd.api+ json" ,
157157 "CUSTOM-HEADER" : "whatever"
158158 } ,
159159 method : "GET"
@@ -309,9 +309,9 @@ describe("fetch middleware", () => {
309309 expect ( before . url ) . to . eq ( "http://example.com/api/v1/authors" )
310310 expect ( before . options ) . to . deep . eq ( {
311311 headers : {
312- Accept : "application/json" ,
312+ Accept : "application/vnd.api+ json" ,
313313 "CUSTOM-HEADER" : "whatever" ,
314- "Content-Type" : "application/json"
314+ "Content-Type" : "application/vnd.api+ json"
315315 } ,
316316 body : JSON . stringify ( { data : { type : "authors" } } ) ,
317317 method : "POST"
Original file line number Diff line number Diff line change @@ -1485,8 +1485,8 @@ describe("Model", () => {
14851485
14861486 it ( "includes the content headers" , ( ) => {
14871487 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" )
14901490 } )
14911491 } )
14921492} )
You can’t perform that action at this time.
0 commit comments