mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-25 14:05:14 +00:00
docs: fix
This commit is contained in:
parent
899c6241c3
commit
225a8e11a9
1 changed files with 2 additions and 6 deletions
|
@ -268,18 +268,14 @@ import MyComponent from './MyComponent.vue';
|
|||
void MyComponent;
|
||||
```
|
||||
|
||||
You can use msw to mock API requests in the storybook. Creating a `MyComponent.stories.msw.ts` file and add the following line to the file.
|
||||
You can use msw to mock API requests in the storybook. Creating a `MyComponent.stories.msw.ts` file to define the mock handlers.
|
||||
|
||||
```ts
|
||||
import { rest } from 'msw';
|
||||
export const handlers = [
|
||||
rest.post('/api/notes/timeline', (req, res, ctx) => {
|
||||
return res(
|
||||
ctx.json({
|
||||
notes: [],
|
||||
users: [],
|
||||
hasNext: false,
|
||||
})
|
||||
ctx.json([]),
|
||||
);
|
||||
}),
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue