Skip to content

Commit

Permalink
updating module file and imports in service
Browse files Browse the repository at this point in the history
  • Loading branch information
Ballioli committed Jun 10, 2024
1 parent e1e3763 commit 4378172
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { DynamicModule } from '@nestjs/common'
import { BaseTemplateAPIModuleConfig } from '../../../../types'
import { UserProfileService } from './user-profile.service'

import { Configuration, UserProfileApi } from '@island.is/clients/user-profile'
import { IslyklarApi, IslykillApiModule } from '@island.is/clients/islykill'
import { Configuration, V2UsersApi } from '@island.is/clients/user-profile'
import { IslykillApiModule } from '@island.is/clients/islykill'
export class UserProfileModule {
static register(config: BaseTemplateAPIModuleConfig): DynamicModule {
return {
Expand All @@ -18,9 +18,9 @@ export class UserProfileModule {
providers: [
UserProfileService,
{
provide: UserProfileApi,
provide: V2UsersApi,
useFactory: () =>
new UserProfileApi(
new V2UsersApi(
new Configuration({
fetchApi: fetch,
basePath: config.userProfile.serviceBasePath,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Injectable } from '@nestjs/common'
import { Auth, AuthMiddleware } from '@island.is/auth-nest-tools'
import { Auth, AuthMiddleware, User } from '@island.is/auth-nest-tools'
import { IslyklarApi } from '@island.is/clients/islykill'
import {
UserProfileControllerFindUserProfileClientTypeEnum,
Expand All @@ -16,7 +16,6 @@ import {
UserProfile,
UserProfileParameters,
} from '@island.is/application/types'
import type { User } from '@island.is/auth-nest-tools'
import { getSlugFromType } from '@island.is/application/core'
import { IdsClientConfig } from '@island.is/nest/config'
import { Inject } from '@nestjs/common'
Expand Down Expand Up @@ -45,7 +44,6 @@ export class UserProfileService extends BaseTemplateApiService {
async userProfile({
auth,
}: TemplateApiModuleActionProps<UserProfileParameters>): Promise<UserProfile> {
// Temporary solution while we still run the old user profile service.
const { mobilePhoneNumber, email } = await this.userProfileApiWithAuth(auth)
.userProfileControllerFindUserProfile({
xParamNationalId: auth.nationalId,
Expand All @@ -71,6 +69,7 @@ export class UserProfileService extends BaseTemplateApiService {
bankInfo,
}
}

private async getBankInfoFromIslykill(auth: User) {
return this.islyklarApi
.islyklarGet({ ssn: auth.nationalId })
Expand Down

0 comments on commit 4378172

Please sign in to comment.