Skip to content

Commit 09f845e

Browse files
authored
Merge pull request #10920 from marmelab/fix-demo-msw
Fix demos with MSW
2 parents ff6b694 + 04ed7e1 commit 09f845e

File tree

6 files changed

+11
-7
lines changed

6 files changed

+11
-7
lines changed

examples/crm/src/providers/fakerest/dataProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { getContactAvatar } from '../commons/getContactAvatar';
2222
import { authProvider, USER_STORAGE_KEY } from './authProvider';
2323
import { withSupabaseFilterAdapter } from './internal/supabaseAdapter';
2424

25-
const baseDataProvider = simpleRestProvider('http://localhost:4000');
25+
const baseDataProvider = simpleRestProvider('https://crm.api.marmelab.com');
2626

2727
const TASK_MARKED_AS_DONE = 'TASK_MARKED_AS_DONE';
2828
const TASK_MARKED_AS_UNDONE = 'TASK_MARKED_AS_UNDONE';

examples/crm/src/providers/fakerest/fakeServer.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ import { type CollectionItem, getMswHandler, withDelay } from 'fakerest';
44
import generateData from './dataGenerator';
55

66
const handler = getMswHandler({
7-
baseUrl: 'http://localhost:4000',
7+
baseUrl: 'https://crm.api.marmelab.com',
88
data: generateData() as CollectionItem,
99
middlewares: [withDelay(300)],
1010
});
11-
export const worker = setupWorker(http.all(/http:\/\/localhost:4000/, handler));
11+
export const worker = setupWorker(
12+
http.all(/https:\/\/crm\.api\.marmelab\.com/, handler)
13+
);
1214

1315
export default () => worker;

examples/demo/src/dataProvider/graphql.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ const customBuildQuery: BuildQueryFactory = introspectionResults => {
115115
export default () => {
116116
const dataProvider = buildApolloClient({
117117
clientOptions: {
118-
uri: 'http://localhost:4000/graphql',
118+
uri: 'https://demo.api.marmelab.com/graphql',
119119
},
120120
introspection: {
121121
operationNames: {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import simpleRestProvider from 'ra-data-simple-rest';
22

3-
export default simpleRestProvider('http://localhost:4000');
3+
export default simpleRestProvider('https://demo.api.marmelab.com');

examples/demo/src/fakeServer/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export default async (type: string) => {
1818
);
1919
}
2020
}
21-
const worker = setupWorker(http.all(/http:\/\/localhost:4000/, fakeServer));
21+
const worker = setupWorker(
22+
http.all(/https:\/\/demo\.api\.marmelab\.com/, fakeServer)
23+
);
2224
return worker;
2325
};

examples/demo/src/fakeServer/rest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import generateData from 'data-generator-retail';
44
export default () => {
55
const data = generateData();
66
const adapter = new MswAdapter({
7-
baseUrl: 'http://localhost:4000',
7+
baseUrl: 'https://demo.api.marmelab.com',
88
data,
99
loggingEnabled: true,
1010
middlewares: [withDelay(300)],

0 commit comments

Comments
 (0)