Skip to content

Commit

Permalink
fix(api): more logs for documents (#16606)
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 Oct 29, 2024
1 parent 886c51f commit cc6778a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libs/api/domains/documents/src/lib/documentV2.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export class DocumentResolverV2 {
this.logger.info('failed to get single document', {
category: LOG_CATEGORY,
provider: input.provider,
documentCategory: input.category,
error: e,
})
throw e
Expand Down Expand Up @@ -116,7 +117,11 @@ export class DocumentResolverV2 {
resources: input.id,
meta: { confirmed: input.confirmed },
})

this.logger.info('confirming document modal', {
category: LOG_CATEGORY,
id: input.id,
confirmed: input.confirmed,
})
return { id: input.id, confirmed: input.confirmed }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ export class DocumentInput {
@IsString()
readonly provider?: string

@Field({ nullable: true, description: 'Optional. For logging only.' })
@IsOptional()
@IsString()
readonly category?: string

@Field({ defaultValue: 10 })
readonly pageSize!: number

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export const DocumentLineV3: FC<Props> = ({
setDocumentDisplayError,
setDocLoading,
setLocalRead,
categoriesAvailable,
localRead,
} = useDocumentContext()

Expand Down Expand Up @@ -152,6 +153,9 @@ export const DocumentLineV3: FC<Props> = ({
input: {
id: documentLine.id,
provider: documentLine.sender?.name ?? 'unknown',
category: categoriesAvailable.find(
(i) => i.id === documentLine?.categoryId,
)?.name,
},
locale: lang,
},
Expand Down Expand Up @@ -189,6 +193,9 @@ export const DocumentLineV3: FC<Props> = ({
id: documentLine.id,
provider: documentLine.sender?.name ?? 'unknown',
includeDocument: false,
category: categoriesAvailable.find(
(i) => i.id === documentLine?.categoryId,
)?.name,
},
},

Expand Down

0 comments on commit cc6778a

Please sign in to comment.