Skip to content

Commit

Permalink
fix(api): add ff to resolver (#16865)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
disaerna and kodiakhq[bot] authored Nov 14, 2024
1 parent 64ad820 commit b434660
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import { HealthDirectorateClientModule } from '@island.is/clients/health-directo
import { Module } from '@nestjs/common'
import { HealthDirectorateResolver } from './health-directorate.resolver'
import { HealthDirectorateService } from './health-directorate.service'
import { FeatureFlagModule } from '@island.is/nest/feature-flags'

@Module({
imports: [HealthDirectorateClientModule],
imports: [HealthDirectorateClientModule, FeatureFlagModule],
providers: [HealthDirectorateResolver, HealthDirectorateService],
})
export class HealthDirectorateModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ import { DonorInput, Organ, OrganDonation } from './models/organ-donation.model'
import type { Locale } from '@island.is/shared/types'
import { Vaccinations } from './models/vaccinations.model'
import { HealthDirectorateService } from './health-directorate.service'

@UseGuards(IdsUserGuard, ScopesGuard)
import {
FeatureFlag,
FeatureFlagGuard,
Features,
} from '@island.is/nest/feature-flags'
@UseGuards(IdsUserGuard, ScopesGuard, FeatureFlagGuard)
@Scopes(ApiScope.internal)
@Audit({ namespace: '@island.is/api/health-directorate' })
@Resolver(() => OrganDonation)
Expand All @@ -35,6 +39,7 @@ export class HealthDirectorateResolver {
name: 'healthDirectorateOrganDonation',
})
@Audit()
@FeatureFlag(Features.servicePortalHealthOrganDonationPageEnabled)
async getDonorStatus(
@Args('locale', { type: () => String, nullable: true })
locale: Locale = 'is',
Expand All @@ -58,6 +63,7 @@ export class HealthDirectorateResolver {
name: 'healthDirectorateOrganDonationUpdateDonorStatus',
})
@Audit()
@FeatureFlag(Features.servicePortalHealthOrganDonationPageEnabled)
async updateDonorStatus(
@Args('input') input: DonorInput,
@Args('locale', { type: () => String, nullable: true })
Expand All @@ -72,6 +78,7 @@ export class HealthDirectorateResolver {
name: 'healthDirectorateVaccinations',
})
@Audit()
@FeatureFlag(Features.servicePortalHealthVaccinationsPageEnabled)
getVaccinations(
@Args('locale', { type: () => String, nullable: true })
locale: Locale = 'is',
Expand Down
3 changes: 2 additions & 1 deletion libs/feature-flags/src/lib/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ export enum Features {
servicePortalVehicleBulkMileagePageEnabled = 'isServicePortalVehicleBulkMileagePageEnabled',
servicePortalSocialInsurancePageEnabled = 'isServicePortalSocialInsurancePageEnabled',
servicePortalSocialInsuranceIncomePlanPageEnabled = 'isServicePortalSocialInsuranceIncomePlanPageEnabled',

servicePortalHealthVaccinationsPageEnabled = 'isServicePortalHealthVaccinationsPageEnabled',
servicePortalHealthOrganDonationPageEnabled = 'isServicePortalHealthOrganDonationPageEnabled',
ServicePortalNotificationsEnabled = 'isServicePortalNotificationsPageEnabled',
servicePortalLawAndOrderModuleEnabled = 'isServicePortalLawAndOrderModuleEnabled',
servicePortalDocumentsActionsEnabled = 'isServicePortalDocumentsActionsEnabled',
Expand Down

0 comments on commit b434660

Please sign in to comment.