Skip to content

Commit

Permalink
fix: oca credential formatter returns all attributes
Browse files Browse the repository at this point in the history
Signed-off-by: Akiff Manji <[email protected]>
  • Loading branch information
amanji authored and jleach committed Dec 6, 2023
1 parent a8dac14 commit 6efc80e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions packages/oca/src/formatters/credential/LocalizedCredential.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@ export default class LocalizedCredential {

this.attributes =
credentialAttributes
?.filter((attribute) => bundle.getFlaggedAttribute(attribute.name))
.map((attribute) => {
const overlayOptions = bundle.getAttribute(attribute.name) ?? { name: attribute.name, type: '' }
return new DisplayAttribute(attribute, overlayOptions, language)
}) ?? []
?.filter((attribute) => bundle.getAttribute(attribute.name))
.map((attribute) => new DisplayAttribute(attribute, { name: attribute.name, type: '' }, language)) ?? []
}

get primaryAttribute(): DisplayAttribute | undefined {
Expand Down
4 changes: 2 additions & 2 deletions packages/oca/src/formatters/credential/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import CredentialFromatter from './CredentialFormatter'
import CredentialFormatter from './CredentialFormatter'
import DisplayAttribute from './DisplayAttribute'
import LocalizedCredential from './LocalizedCredential'

export { CredentialFromatter, DisplayAttribute, LocalizedCredential }
export { CredentialFormatter, DisplayAttribute, LocalizedCredential }

0 comments on commit 6efc80e

Please sign in to comment.