mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 12:25:22 +02:00
chore(deps): upgrade to msw v2 [EE-6489] (#10911)
This commit is contained in:
parent
ecd603db8c
commit
400a80c07d
19 changed files with 2602 additions and 1669 deletions
|
@ -1,14 +1,12 @@
|
|||
import { DefaultBodyType, PathParams, rest } from 'msw';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
|
||||
import { TeamMembership } from '@/react/portainer/users/teams/types';
|
||||
import { createMockUsers } from '@/react-tools/test-mocks';
|
||||
|
||||
export const userHandlers = [
|
||||
rest.get('/api/users', async (req, res, ctx) =>
|
||||
res(ctx.json(createMockUsers(10)))
|
||||
),
|
||||
rest.get<DefaultBodyType, PathParams, TeamMembership[]>(
|
||||
http.get('/api/users', async () => HttpResponse.json(createMockUsers(10))),
|
||||
http.get<never, never, TeamMembership[]>(
|
||||
'/api/users/:userId/memberships',
|
||||
(req, res, ctx) => res(ctx.json([]))
|
||||
() => HttpResponse.json([])
|
||||
),
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue