mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-31 09:56:44 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			28 lines
		
	
	
		
			642 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			642 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| import { rest } from 'msw';
 | |
| import { setupServer } from 'msw/node';
 | |
| 
 | |
| export const server = setupServer(
 | |
|   ...[
 | |
|     rest.post('/admin/permissions/check', async (req, res, ctx) => {
 | |
|       return res(
 | |
|         ctx.json({
 | |
|           data: [true],
 | |
|         })
 | |
|       );
 | |
|     }),
 | |
|     rest.get('/use-fetch-client-test', (req, res, ctx) => {
 | |
|       return res(
 | |
|         ctx.json({
 | |
|           data: {
 | |
|             results: [
 | |
|               { id: 2, name: 'newest', publishedAt: null },
 | |
|               { id: 1, name: 'oldest', publishedAt: null },
 | |
|             ],
 | |
|             pagination: { page: 1, pageCount: 10 },
 | |
|           },
 | |
|         })
 | |
|       );
 | |
|     }),
 | |
|   ]
 | |
| );
 | 
