mirror of
				https://github.com/immich-app/immich.git
				synced 2025-10-31 02:39:03 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			463 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			463 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { APIKeyCreateResponseDto } from '@app/domain';
 | |
| import { apiKeyCreateStub } from '@test';
 | |
| import request from 'supertest';
 | |
| 
 | |
| export const apiKeyApi = {
 | |
|   createApiKey: async (server: any, accessToken: string) => {
 | |
|     const { status, body } = await request(server)
 | |
|       .post('/api-key')
 | |
|       .set('Authorization', `Bearer ${accessToken}`)
 | |
|       .send(apiKeyCreateStub);
 | |
| 
 | |
|     expect(status).toBe(201);
 | |
| 
 | |
|     return body as APIKeyCreateResponseDto;
 | |
|   },
 | |
| };
 |