File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed
crm/src/providers/fakerest Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 11import { http } from 'msw' ;
22import { setupWorker } from 'msw/browser' ;
3- import { type CollectionItem , getMswHandler } from 'fakerest' ;
3+ import { type CollectionItem , getMswHandler , withDelay } from 'fakerest' ;
44import generateData from './dataGenerator' ;
55
66const handler = getMswHandler ( {
77 baseUrl : 'http://localhost:4000' ,
88 data : generateData ( ) as CollectionItem ,
9+ middlewares : [ withDelay ( 300 ) ] ,
910} ) ;
1011export const worker = setupWorker ( http . all ( / h t t p : \/ \/ l o c a l h o s t : 4 0 0 0 / , handler ) ) ;
1112
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ export default () => {
77 baseUrl : 'http://localhost:4000' ,
88 data,
99 loggingEnabled : true ,
10- middlewares : [ withDelay ( 500 ) ] ,
10+ middlewares : [ withDelay ( 300 ) ] ,
1111 } ) ;
1212 if ( window ) {
1313 window . restServer = adapter . server ; // give way to update data in the console
Original file line number Diff line number Diff line change 11import data from './data' ;
22import { http } from 'msw' ;
33import { setupWorker } from 'msw/browser' ;
4- import { getMswHandler } from 'fakerest' ;
4+ import { getMswHandler , withDelay } from 'fakerest' ;
55
66const handler = getMswHandler ( {
77 baseUrl : 'http://localhost:4000' ,
88 data,
9+ middlewares : [ withDelay ( 300 ) ] ,
910} ) ;
1011export const worker = setupWorker ( http . all ( / h t t p : \/ \/ l o c a l h o s t : 4 0 0 0 / , handler ) ) ;
1112
You can’t perform that action at this time.
0 commit comments