Skip to content

Commit

Permalink
feat: generic attachment handler
Browse files Browse the repository at this point in the history
fixed fct declaration and henceforth tests

Co-authored-by: annelein <anneleinvanreijen@gmail.com>

Signed-off-by: morrieinmaas <moritz@animo.id>
  • Loading branch information
morrieinmaas committed Dec 15, 2021
1 parent 92acbb6 commit 4c58e5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/decorators/attachment/Attachment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ export class AttachmentData {
}
}

public getDataAsJson = () => {
public getDataAsJson() {
if (this.base64 !== null && typeof this.base64 === 'string') {
return JsonEncoder.fromBase64(this.base64)
} else if (this.json !== null) {
return this.json
} else {
throw new AriesFrameworkError('No data available.')
throw new AriesFrameworkError('No attachment data available.')
}
}

Expand Down

0 comments on commit 4c58e5a

Please sign in to comment.