Skip to content

Commit

Permalink
Remove unused code.
Browse files Browse the repository at this point in the history
  • Loading branch information
valure committed Nov 5, 2024
1 parent 2d97d44 commit 662588e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 561 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ import {
import { ApiOkResponse, ApiTags } from '@nestjs/swagger'

import {
DelegationDTO,
DelegationScopeService,
DelegationsIncomingService,
DelegationsIndexService,
DelegationsService,
MergedDelegationDTO,
} from '@island.is/auth-api-lib'
import {
Expand Down Expand Up @@ -45,33 +43,16 @@ export class DelegationsController {
constructor(
@Inject(LOGGER_PROVIDER)
protected readonly logger: Logger,
private readonly delegationsService: DelegationsService,
private readonly delegationScopeService: DelegationScopeService,
private readonly delegationsIncomingService: DelegationsIncomingService,
private readonly delegationIndexService: DelegationsIndexService,
) {}

@Scopes('@identityserver.api/authentication')
@Version([VERSION_NEUTRAL, '1', '2'])
@Get()
@ApiOkResponse({ isArray: true })
async findAllToV1(@CurrentUser() user: User): Promise<DelegationDTO[]> {
const delegations = await this.delegationsService.findAllIncoming(user)

// don't fail the request if indexing fails
try {
void this.delegationIndexService.indexDelegations(user)
} catch {
this.logger.error('Failed to index delegations')
}

return delegations
}

@Scopes('@identityserver.api/authentication')
@Version('2')
@Get()
@ApiOkResponse({ isArray: true })
async findAllToV2(@CurrentUser() user: User): Promise<MergedDelegationDTO[]> {
async findAllTo(@CurrentUser() user: User): Promise<MergedDelegationDTO[]> {
const delegations = await this.delegationsIncomingService.findAllAvailable({
user,
})
Expand Down
Loading

0 comments on commit 662588e

Please sign in to comment.