Skip to content

Commit

Permalink
Fixed PR comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonbjarnio committed Sep 30, 2024
1 parent f76e177 commit 1047eef
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { Field, ObjectType } from '@nestjs/graphql'

@ObjectType('OfficialJournalOfIcelandApplicationGetUserInvolvedParty')
export class InvovledParty {
@Field()
export class InvolvededParty {
@Field({ description: 'The id of the involved party' })
id!: string

@Field()
@Field({ description: 'The title of the involved party' })
title!: string

@Field()
@Field({ description: 'The slug of the involved party' })
slug!: string
}

@ObjectType('OfficialJournalOfIcelandApplicationGetUserInvolvedPartiesResponse')
export class GetUserInvolvedPartiesResponse {
@Field(() => [InvovledParty])
involvedParties!: InvovledParty[]
@Field(() => [InvolvededParty])
involvedParties!: InvolvededParty[]
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const InvolvedPartyScreen = ({
},
onComplete: (data) => {
const involvedParties =
data?.officialJournalOfIcelandApplicationGetUserInvolvedParties
data.officialJournalOfIcelandApplicationGetUserInvolvedParties
.involvedParties

if (involvedParties.length === 0 || involvedParties.length > 1) {
Expand All @@ -37,9 +37,7 @@ export const InvolvedPartyScreen = ({
data.officialJournalOfIcelandApplicationGetUserInvolvedParties
.involvedParties.length === 1
) {
const involvedParty =
data.officialJournalOfIcelandApplicationGetUserInvolvedParties
.involvedParties[0]
const involvedParty = involvedParties[0]

setValue(InputFields.advert.involvedPartyId, involvedParty.id)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,19 @@ export class OfficialJournalOfIcelandApplicationClientService {
}

async getUserInvolvedParties(params: GetInvolvedPartiesRequest, auth: Auth) {
const data = await this.ojoiApplicationApiWithAuth(auth).getInvolvedParties(
params,
)
console.log(data)
return data
try {
const data = await this.ojoiApplicationApiWithAuth(
auth,
).getInvolvedParties(params)
return data
} catch (error) {
this.logger.warn('Failed to get involved parties', {
error,
applicationId: params.id,
category: LOG_CATEGORY,
})

throw error
}
}
}

0 comments on commit 1047eef

Please sign in to comment.