@@ -192,7 +192,7 @@ function createHandlers(baseUrl: string, kernel: ObjectKernel, driver: InMemoryD
192192 ) : null ;
193193
194194 console . log ( 'MSW: getData result' , JSON . stringify ( record ) ) ;
195- return HttpResponse . json ( record , { status : record ? 200 : 404 } ) ;
195+ return HttpResponse . json ( { record } , { status : record ? 200 : 404 } ) ;
196196 } catch ( e ) {
197197 console . error ( 'MSW: getData error' , e ) ;
198198 return HttpResponse . json ( { error : String ( e ) } , { status : 500 } ) ;
@@ -205,7 +205,7 @@ function createHandlers(baseUrl: string, kernel: ObjectKernel, driver: InMemoryD
205205 console . log ( 'MSW: createData' , params . objectName , JSON . stringify ( body ) ) ;
206206 const response = await driver . create ( params . objectName as string , body as any ) ;
207207 console . log ( 'MSW: createData result' , JSON . stringify ( response ) ) ;
208- return HttpResponse . json ( response , { status : 201 } ) ;
208+ return HttpResponse . json ( { record : response } , { status : 201 } ) ;
209209 } ) ,
210210
211211 // Data endpoints - Update
@@ -214,7 +214,7 @@ function createHandlers(baseUrl: string, kernel: ObjectKernel, driver: InMemoryD
214214 console . log ( 'MSW: updateData' , params . objectName , params . id , JSON . stringify ( body ) ) ;
215215 const response = await driver . update ( params . objectName as string , params . id as string , body as any ) ;
216216 console . log ( 'MSW: updateData result' , JSON . stringify ( response ) ) ;
217- return HttpResponse . json ( response , { status : 200 } ) ;
217+ return HttpResponse . json ( { record : response } , { status : 200 } ) ;
218218 } ) ,
219219
220220 // Data endpoints - Delete
0 commit comments