Method
getById
(auth: AuthDto, id: string)
Source from the content-addressed store, hash-verified
| 68 | } |
| 69 | |
| 70 | async getById(auth: AuthDto, id: string): Promise<ApiKeyResponseDto> { |
| 71 | const key = await this.apiKeyRepository.getById(auth.user.id, id); |
| 72 | if (!key) { |
| 73 | throw new BadRequestException('API Key not found'); |
| 74 | } |
| 75 | return this.map(key); |
| 76 | } |
| 77 | |
| 78 | async getAll(auth: AuthDto): Promise<ApiKeyResponseDto[]> { |
| 79 | const keys = await this.apiKeyRepository.getByUserId(auth.user.id); |
Tested by
no test coverage detected